luckfox
luckfox · 共 32 篇文章
讓Mac的finder能顯示隱藏檔
讓finder能顯示隱藏檔 defaults write com.apple.finder AppleShowAllFiles -bool true 讓finder不能顯示隱藏檔 defaults write com.apple.finder AppleShowAllFiles -bool false
2013-03-21 17:31 · 评论(0)
storyBoard的使用,使用performSegueWithIdentifier來切換ViewController
原本以為使用performSegueWithIdentifier就可以輕鬆切換ViewController,沒想到一直發生錯誤 原來是要在IB中的segue的identifier寫下identifier,否則會錯誤 另外在stept3 的部分可以設定過場的畫面 - (IBAction)GoViewButton01:(id)sender { [self performseguewithidentifier:@"viewcontroller01" sender:sender]; }
2013-03-08 17:56 · 评论(0)
一個google map的範例(1)
// // UIgmapDemoViewController.h // UIgmapDemo // // Created by Administrator on 13/3/6. // Copyright (c) 2013年 Administrator. All rights reserved. // #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface UIgmapDemoViewController : UIViewController { //MKMapView *mapView; } @property (weak,n…
2013-03-08 14:25 · 评论(0)
protocol 和 delegate
目標: 延續範例http://luckfox.iteye.com/blog/1826126,加上protocol/delegate示範 // // UIStoryboardSubViewController.h // StoryboardDemo0 // // Created by Administrator on 13/3/7. // Copyright (c) 2013年 Administrator. All rights reserved. // #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> //step 1. 告知…
2013-03-08 13:54 · 评论(0)
storyBoard 運用,兩個ViewController之間的資料傳送
目標: 1.storyBoard的介紹與使用 2.在不同viewController間傳送資料 使用storyBoard, 首先要確定是否有存在多個,如果有多個storyBoard,則可以在plist 檔案中的;則是指出哪一個storyBoard才是我們所使用的,在點選storyBoard,畫面會出現step 1 的按鈕,此按鈕可以用來開關 storyBoard下所有viewController的清單.在清單中可以拖曳來決定ViewController的開啓流程.感覺確實比用nib 的方式要直覺得 許多. 此storyBoard共包含了三個viewController,本範例中共會使用到兩個…
2013-03-08 12:00 · 评论(0)
半手工打造一個Viewer (配合NIB)
// // main.m // // // Created by unknown on 12/6/1. // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> // 好用的列按鈕項目建立巨集 #define BARBUTTON(TITLE, SELECTOR) [[uibarbuttonitem alloc] \ initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self \ action:SELECT…
2012-06-01 17:14 · iphone/ipad · 评论(0)
手工打造一個Viewer
// // main.m // // // Created by unknown on 12/6/1. // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> // 好用的列按鈕項目建立巨集 #define BARBUTTON(TITLE, SELECTOR) [[uibarbuttonitem alloc] \ initWithTitle:TITLE style:UIBarButtonItemStylePlain target:self \ action:SELECT…
2012-06-01 15:27 · iphone/ipad · 评论(0)
在xcode 4.2中開啟(build setting/project setting)
如下圖,在a.地方點選右鍵,(Open as/xcode project),在b.地方選擇正確的target
2012-02-22 18:25 · 评论(0)
EXC_BAD_ACCESS 錯誤排除
在xcode 4.2中,Product/Edit Scheme(或是 "cmd+<")會出現 在左側的Run部分正確點選後,在下方Environment Virable加入一個變數NSZombieEnabled, 並設定Value=YES
2012-02-22 18:00 · 评论(0)
iphone/ipad
本章將建立一個最簡單的iphone範例程式(xcode 4.2),如同所有的入門範例ㄧ樣 將使用Hello World 1.如下圖,選取第一個選項,"Create a new xcode project" 2.此project的template使用sing view application來建立 3.賦予此project一個有意義的名字,在本章中,先不使用storyboard,並且使用GC(Garbage collection),所以注意到該圖的勾選項 4.點選左側project,viewController_iphone,在開啓右側的object inspector,將Button和Tex…
2012-02-20 13:17 · iphone/ipad · 评论(0)
如何在ubuntu下的gcc 來編譯object-C
如何在ubuntu下的gcc 來編譯object-C sudo apt-get install gnustep sudo apt-get install gnustep-devel 安裝完畢後,便可以透過make來編譯 ############################################################################### 如果出現下面錯誤,則表示找不到NextSetup的相關liberary,必須要修正script shell為下 gcc gnustep-config --objc-flags -lgnustep-base hello.…
2012-01-20 14:14 · 评论(0)
含有ObjectC的Automake操作
@寫完基本的程式後 hello.m #import <stdio.h> int main(int argc,const char *argv[]) { printf("hello world\n"); return 0; } step 1. autoscan 會產生 configure.scan step 2. mv configure.scan configure.in 修改configure.in的內容,並且加入(修改)下面四行 AM_INIT_AUTOMAKE(jeffrey,1.0) AC_PROG_OBJC AM_CONDITIONAL(, false) AC_OUTPUT(Mak…
2012-01-20 11:50 · 评论(0)
用intent切換兩個activity
//intent_activity_main.java package android.demo.intent_activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class intent_activity_main extends Activit…
2011-07-26 15:25 · 用intent切換兩個activity · 评论(0)
ToneGenerator+MessageHandler用法
package android.demo.dialtone; import java.util.HashMap; import android.app.Activity; import android.content.Context; import android.media.AudioManager; import android.media.ToneGenerator; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.provider.Settin…
2011-05-24 17:21 · 评论(0)
取得JAVA下的__LINE__
public class Test10 { public static void main(String args[]) { System.out.println("This is " + getLineInfo()); } public static String getLineInfo() { StackTraceElement ste = new Throwable().getStackTrace()[1]; return ste.getFileName() + ": Line " + ste.getLineNumber(); } }
2011-05-13 13:35 · 评论(0)