Recently in SDK Category

Triggering Vibration

| No Comments | No TrackBacks
Applications running on iPhone--but not the iPod touch--can trigger vibration using System Audio 
Services. The vibrate option is identified using the kSystemSoundID_Vibrate identifier. To trigger 
it, use the AudioServicesPlaySystemSound function in the Audio Toolbox framework, as shown 
here. 

#import <AudioToolbox/AudioToolbox.h> 
#import <UIKit/UIKit.h> 
- (void)vibratePhone 

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 
首先是官方SDK的實現, 很簡單:
只需在Info.plist文件離添加如下一句話就ok
UIStatusBarHidden
fullscreen.png

以下是非官方的實現:
只要在 applicationDidFinishLaunching 的開始部份,
加上下面的 setStatusBarMode 代碼即可:
Quote:

- (void) applicationDidFinishLaunching: (id) unused
{
    [UIHardware _setStatusBarHeight:0.0f];
    [self setStatusBarMode:2 orientation:0 duration:0.0f fenceID:0];

iPhone SDK Release Notes for iPhone OS 2.0

Known Issues

Xcode/Developer Tools

  • You may only use .png files for application icons for the device.

  • You may receive iTunes error messages when installing an IPSW onto the phone via Xcode. (✔)

  • The iPhone SDK is designed for Intel-based Macs and is not supported on PPC-based Macs.(✔)

  • Xcode and the iPhone SDK only work in 32-bit mode; 64-bit mode is not supported.

  • When running and debugging on a device, be sure to turn off Passcode lock.

  • Using the Xcode menu Run > Start with Performance Tool > <instrument> does not work even though it is enabled. The application is not uploaded to the device. When the application is already present, Instruments targets the local machine and "Target failed to start" appears in the tracks.

  • Trying to debug two applications at the same time on the same device fails with a broken pipe error in the debugger console.

  • Instruments will act unpredictably with multiple devices attached

iPhone Simulator

  • iPhone Simulator does not support network home directories.

  • The version of Foundation in the simulator platform includes functionality not included in iPhone OS. To ensure functionality is not used that is not present on iPhone, check the documentation for availability information.

UIImage

  • You have to specify the image extension to -imageNamed: to get results.

UIKit

  • Applications using UINavigationController cannot be launched in landscape mode.

UILabel

  • Including the degree character in a format string disables text updates to a UILabel object.

  • UILabel ignores its contentMode property.

UIScrollView

  • After zooming, content inset is ignored and content is left in the wrong position.

UIStringDrawing

  • UILineBreakModeTruncateHead and UILineBreakModeMiddleTruncation do not work properly for multiline text.

UITableView

  • UITableView ignores separatorStyle and separatorColor.

  • The list of styles available for UITableView specifies "Indexed" and "Grouped" as the two available options; however, the headers and documentation refer to "Indexed" as "Plain".

  • UITextView objects embedded inside a UITableViewCell never receive touches.

  • It is very, very expensive to customize row heights (via tableView:heightForRowAtIndexPath:).

  • Unable to resize table wider than the screen.

UITextField

  • UITextField cannot be made to resign first responder once offscreen.

UITextView

  • UITextView's loupe ignores the underlying view's background color.

  • Setting UITextView.editable to YES should not automatically show the keyboard.

UIToolbarController

  • -[UIToolbarController setSelectionIndex] doesn't work for members of the viewControllers array that are offscreen.

UITouch

  • UITouch is not adjusted when a layer has a transform applied to it.

  • UITouch does not properly handle multiple taps from multiple fingers.

  • An application will not receive UITouchPhaseBegan if a swipe begins on or above the status bar.

UIView

  • Many UIKit controls cannot be resized properly if initialized with a CGRectZero frame.

  • animationDidEnd fires too soon and can cause animations to stutter if you do too much work in the callback.

  • If a view subclass implements -drawRect: then the background color for that view subclass cannot be animated.

UIViewController

  • UINavigationController won't resize content view automatically if barStyle is changed to/from UIBarStyleBlackTranslucent.

  • If a view is detached from a given UIViewController as a top-level nib object, but connected as an outlet, the view's origin is incorrectly moved upwards by approximately 24 pixels.

  • UIViewController does not support fading to a different view when rotated to landscape.

UIWebView

  • UIViewController does not auto-rotate when added to a window that is rotated already.

  • Links don't highlight when WebKit is single threaded.

Media

  • MPVolumeView cannot be created using Interface Builder. To use an MPVolumeView, create it programmatically as you would a normalUIView and call sizeToFit, as follows:



    CGRect frame = CGRectMake(originX, originY, width, 0);


    MPVolumeView *volumeView = [[[MPVolumeView alloc]



    initWithFrame:frame] autorelease];

    [volumeView sizeTo


    [myView addSubview:volumeView];]]




About this Archive

This page is an archive of recent entries in the SDK category.

Objective-C is the previous category.

TAO is the next category.

Find recent content on the main index or look in the archives to find all content.