顯示具有 iOS SDK 標籤的文章。 顯示所有文章
顯示具有 iOS SDK 標籤的文章。 顯示所有文章

2012年7月23日 星期一

走在時代尖端,搶先安裝iOS 6


雖然彼得潘只是個小小的App開發者,但是新時代的工程師已經不流行做宅男了。彼得潘決定朝著走在時代尖端的方向努力,在2012秋天Apple正式公佈iOS 6前,搶先使用iOS 6,探究最新的iOS 6 SDK開發技術。



1. 下載iOS 6 beta檔案。(.lpsw檔)

如果是付費的iOS開發者,從官方的開發網站即可免費取得最新的iOS 6 beta。如果不是,借助敵人google大神的幫忙,也是沒有辦法中的唯一辦法。記住iOS 6檔案十分挑食,它有著綁定機型的特性,請勿將for iPhone 4s的檔案裝到iPad上。

2. iTunes至少10.6.3以上

3. 連接iPhone和Mac

4. 在iTunes的iPhone頁面,按住option鍵,然後再點選Check for Update,啟動選擇安裝檔案的視窗。


選擇lpsw檔安裝。




彼得潘的iPhone終於升級為iOS 6了。





2012年6月25日 星期一

WWDC 2012值得一看的Session Video


App的誕生,是段漫長又艱辛的旅程,就讓Apple的專家給我們些金玉良言吧!
Basics+Habits: Building Your Software Projects To Last

開發工具的使用
Developer Tools Kickoff
  Working Efficiently with Xcode
Working with Schemes and Projects in Xcode
Building from the Command Line with Xcode
Source Control Management in Xcode
Learning Instruments

Collection View介紹
Introducing Collection Views
  Advanced Collection Views and Building Custom Layouts
   
Passbook介紹
    Introducing Passbook, Part 1
    Introducing Passbook, Part 2
   
成為Social達人  
    Integrating With Facebook, Twitter and Sina Weibo
   
Newsstand App介紹
    Building Great Newsstand Apps
   
Debug技巧
Debugging in Xcode
Debugging with LLDB

Auto Layout介紹
Introduction to Auto Layout for iOS and OS X
Best Practices for Mastering Auto Layout
Auto Layout by Example

Scroll View運用
Enhancing User Experience with Scroll Views

In-App Purchase
Selling Products with Store Kit
Managing Subscriptions with In-App Purchase

view controller
The Evolution of View Controllers on iOS

UI
Polishing Your Interface Rotations
Advanced Appearance Customization on iOS
iOS User Interface Design

Special
Up and Running: Making a Great Impression with Every Launch
Saving and Restoring Application State on iOS


Performance
iOS App Performance: Memory
iOS App Performance: Responsiveness
iOS App Performance: Graphics and Animations
Building Concurrent User Interfaces on iOS
Asynchronous Design Patterns with Blocks, GCD, and XPC

Network
Networking Best Practices

Core Data
Core Data Best Practices

iCloud
iCloud Storage Overview
Using iCloud with Core Data
Using iCloud with UIDocument
Advanced iCloud Document Storage

LBS
   Getting Around Using Map Kit
   Staying on Track with Location Services

Objective-C
Migrating to Modern Objective-C
Modern Objective-C

Core Image
Getting Started with Core Image
Core Image Techniques

手指連心的手勢感應
Building Advanced Gesture Recognizers

Event Kit
Events and Reminders in Event Kit

國際化的技巧
Internationalization Tips and Tricks

Game Center
Game Technologies Kickoff
Integrating Your Games with Game Center
Multiplayer Gaming with Game Center

Core Motion
Understanding Core Motion

Security and Privacy
Protecting the User's Data
Privacy Support in iOS and OS X
The Security Framework

B2B
Building and Distributing Custom B2B Apps for iOS

繪製個性化的字串
Introduction to Attributed Strings for iOS
Advanced Attributed Strings for iOS

Accessory
iOS Accessories

New
What's New in iTunes Connect for App Developers
What's New in Cocoa Touch
What's New in LLVM
What's New in Game Center
What's New in HTTP Live Streaming


2011年11月19日 星期六

設定Lock畫面顯示的播放音樂資訊 - 戴佩妮[回家路上]App解密




MPNowPlayingInfoCenter *playInfo =[MPNowPlayingInfoCenter defaultCenter];

UIImage *albumArtImage = [UIImage imageNamed:@"Default.png"];

MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage:albumArtImage];

NSArray *objs = [NSArray arrayWithObjects:@"我在乎" ,@"戴佩妮", albumArt, nil];

NSArray *keys = [NSArra arrayWithObjects:

MPMediaItemPropertyTitle, MPMediaItemPropertyArtist,

MPMediaItemPropertyArtwork, nil];

playInfo.nowPlayingInfo = [NSDictionary dictionaryWithObjects: objs forKeys:keys];


2011年4月20日 星期三

vibrate on iOS

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
( add AudioToolbox.framework) 

2011年4月16日 星期六

multitouch on iOS

get touch events for specific view


-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSSet *touchesForTestView = [event touchesForView:testView];
}

2011年4月15日 星期五

create global variable on iOS project

ex:
test.m 
int a = 3;

hello.h
extern int a;

useA.m
#import hello.h

NSNotificationCenter

- (void)addObserver:(id)observer selector:(SEL)aSelector :(NSString *)aName object:(id)anObject;
register to receive notification
parameter:
1. observer: the object to receive notification

2. aName: name of notification, if it is nil, we receive all notifications sent out by anObject

3. anObject: specify object we want to observe. If it is nil, we receive all notification with aName

we can register many objects to receive same notification.


- (void)postNotificationName:(NSString *)aName object:(id)anObject;
send notfication
parameter:
anObject: sender




2011年4月9日 星期六

responder chain in iOS & Cocoa

events are passed through responder chain

ex:
if first responder is view A
when view A does not handle event, it forward event to next responder, its view controller
if view controller  does not handle event, it forward event to view A's parent view B
if view B does not handle event, it forward event to its view controller
Hence,  sequence is
view A ->  view A's view controller -> view A's parent view B -> view A's parent view B's view controller
note:
if event is passed through all view hierarchy, it is then passed to app's window. If window does not handle event, it is passed to UIApplication object

forward an event:
ex:
[self.nextResponder processEvent:event];

CMMotionManager

passive detect:
get data from callback

active detect:
get data when we need

acceleration value for different device orientations:

2011年4月8日 星期五

UIKit and thread

when dealing with UIKit class, we must be in the main thread
If we are not in the main thread,
and we want to modify label's text,
we must do following
->

[textLabel performSelectorOnMainThread:@selector(setText:)  
      withObject:@"hello" waitUntilDone:YES];

operation is iOS SDK

Add operations into operation queue and queue will manage operation for us

operation type:
1. Block operation
2. Invocation operation
3. Plane operation

operation 執行的順序和加入operation queue的順序無關

UINavigationBar

height:
44

2011年4月6日 星期三

2011年3月30日 星期三

2011年3月29日 星期二

save data using plist

只有以下類別的物件可以利用writeToFile:atomically:存入plist

NSArray
NSMutableArray
NSDictionary
NSMutableDictionary
NSData
NSMutableData
NSString
NSMutableString
NSNumber
NSDate

UITextField: 按下鍵盤上的return後,讓鍵盤消失

關鍵:  UIControlEventEditingDidEndOnExit和resignFirstResponder


ex:
          Enter鍵按下時觸發的method

    -(void)textFieldDone:(UITextField*)textField
    {
         [textField resignFirstResponder];
    }


          建立TextField

    textField = [[UITextField alloc] initWithFrame:
                              CGRectMake(5, 5,  
                                         image.size.width,
                                         image.size.height)];
    [imageView addSubview:textField];
    [textField addTarget:self  
          action:@selector(textFieldDone:)  
         forControlEvents:UIControlEventEditingDidEndOnExit];
    [textField release];