語言為內建注音的話
- []=「」
- \=、
- shift + 1=!
- shift + , =,
- shift + . = 。
- shift + ?=?
- shift + []=『』
- shift + ; = :
- option + ; =;
持續增加
#pragma mark -
![]() |
| 線段分類 |
#pragma mark - test
![]() |
| 以test為分類的標題 |
#pragma mark - test
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
UIButton *btnDownLoad = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btnDownLoad setTitle:@"test" forState:UIControlStateNormal];
[btnDownLoad addTarget:self action:@selector(testDL) forControlEvents:UIControlEventTouchUpInside];
btnDownLoad.frame = CGRectMake(100, 100, 100, 100);
[self.view addSubview:btnDownLoad];
// Do any additional setup after loading the view.
}
//FIXME:fix
- (void) testDL
{
NSURL *url = [NSURL URLWithString:@"http://funwish.net/jhaoheng/testDL.rtf"];
NSURLRequest *theRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10.0];
connection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
connection = nil;
}
//TODO:todo
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
filesize = [NSNumber numberWithUnsignedInteger:[response expectedContentLength]];
}
//???:??????
//!!!:!!!!!!!!!!!!
- (void)connection:(NSURLConnection *)theConnection didReceiveData:(NSData *)recievedData {
if (data==nil) {
data = [[NSMutableData alloc] initWithCapacity:2048];
}
[data appendData:recievedData];
//NSNumber *resourceLength = [NSNumber numberWithUnsignedInteger:[data length]]; //MAGIC
//float progress = [resourceLength floatValue] / [filesize floatValue];
//progressLine.progress = progress;
}
![]() |
| 其它相關 |
Improvements:A "Search" filter has been added to the Files tabImproved autocompletion for HTML, CSS, Javascript, and PHPThe path bar is now truncated to your local / remote root pathPort, User, and IdentityFile in ~/.ssh/config are now parsed for SFTP connectionsOption+Return will now open files in the active tab/split via keyboardAdded Japanese localizationAdded a LESS mode. (If you installed a third-party mode, you might wish to delete it.)
Significantly improved stability on Mac OS X 10.6Hopefully improved the reliability of iCloudImproved the reliability of AirPreviewImproved private key reliability for SFTP connectionsWeb preview more reliably catches external CSS changesPHP rendering will no longer break after saving in some circumstancesFixed an issue where the location of the document cannot be determinedFixed an exception when attempting to clone a Git repositoryFixed issues with code foldingNow possible again to add/edit a search URL for a custom bookNo auto-mark for publishing after ejecting siteSave As no longer also saves to FTP in some circumstancesGit push/pull buttons are no longer gone after a commitFixed a Git error when trying to clone a site to a non-existent directoryCheckout to Revision now works more reliably for GitCode validation improved when collapsedImproved nested Javascript syntax coloringNew Tab and New Split subitems now have unique names so shortcuts can be assignedSSH key selector button now shows hidden filesThe connect button in Sharing is now activeClips can no longer lock up when moving them into a groupRight-clicking in icon view no longer clears the selectionJavascript hints now function properlyUsing the keyboard to navigate through tabs now properly scrolls the tabsWorked around mod_sftp server issue where permissions would be set to 000 when openingFixed a situation where named placeholders could not be named properlyThe mysterious iCloud panel is now disabled on Mac OS X 10.8SCM operations now update the publishing queue"Refresh" menu item and keyboard shortcut now works in SQL viewCMD-F now properly focuses filter boxesViewing page source while previewing in iPad/iPhone frames now renders correctlyThe Color pop is now shown for "border-color"Dragging a remote file tab is now more usefulSCM operations when offline no longer create a string of errorsInvisible files now show up in Find Files resultsThe "Port" is now saved properly in SQL site configurationsCustom book images no longer get stretched in the toolbar iconFixed an issue where the Clips editor window could appear far offscreenFixed various crashes, exceptions, and annoyances!
![]() |
| 圖1 |
![]() |
| 圖二 |
| 圖三 |
![]() |
| 圖四 |
[目前的頁面 presentModalViewController:將要跳轉的頁面 animated:YES];
[self dismissModalViewControllerAnimated:YES];//切換過的畫面,跳回上一層畫面相關使用方法,請參閱其他資源。
#import <UIKit/UIKit.h> @interface ViewController : UIViewController<UITableViewDelegate,UITableViewDataSource> @end
NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];
NSArray* languages = [defs objectForKey:@"AppleLanguages"];
NSString* preferredLang = [languages objectAtIndex:0];
NSLog(@"%@",preferredLang);
/*
for (int i=0; i國際設定->語言->語言列表array...[0][1][2][3][4]
General -> international -> Language -> language list , array[0][1][2][3][4]
*/
NSLog(@"this : %@",[[UIDevice currentDevice] model]); //獲取目前使用的設備 NSLog(@"%@",[[UIDevice currentDevice] name]); // Name of the phone as named by user NSLog(@"%@",[[UIDevice currentDevice] uniqueIdentifier]); // A GUID like string NSLog(@"%@",[[UIDevice currentDevice] systemName]); // "iPhone OS" NSLog(@"%@",[[UIDevice currentDevice] systemVersion]); // "2.2.1" NSLog(@"%@",[[UIDevice currentDevice] model]); // "iPhone" on both devices NSLog(@"%@",[[UIDevice currentDevice] localizedModel]); // "iPhone" on both devices
//
// UIDevice.h
// UIKit
//
// Copyright (c) 2007-2011, Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKitDefines.h>
typedef enum {
UIDeviceOrientationUnknown,
UIDeviceOrientationPortrait, // Device oriented vertically, home button on the bottom
UIDeviceOrientationPortraitUpsideDown, // Device oriented vertically, home button on the top
UIDeviceOrientationLandscapeLeft, // Device oriented horizontally, home button on the right
UIDeviceOrientationLandscapeRight, // Device oriented horizontally, home button on the left
UIDeviceOrientationFaceUp, // Device oriented flat, face up
UIDeviceOrientationFaceDown // Device oriented flat, face down
} UIDeviceOrientation;
typedef enum {
UIDeviceBatteryStateUnknown,
UIDeviceBatteryStateUnplugged, // on battery, discharging
UIDeviceBatteryStateCharging, // plugged in, less than 100%
UIDeviceBatteryStateFull, // plugged in, at 100%
} UIDeviceBatteryState; // available in iPhone 3.0
typedef enum {
#if __IPHONE_3_2 <= __IPHONE_OS_VERSION_MAX_ALLOWED
UIUserInterfaceIdiomPhone, // iPhone and iPod touch style UI
UIUserInterfaceIdiomPad, // iPad style UI
#endif
} UIUserInterfaceIdiom;
/* The UI_USER_INTERFACE_IDIOM() macro is provided for use when deploying to a version of the iOS less than 3.2. If the earliest version of iPhone/iOS that you will be deploying for is 3.2 or greater, you may use -[UIDevice userInterfaceIdiom] directly.
*/
#define UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone)
#define UIDeviceOrientationIsPortrait(orientation) ((orientation) == UIDeviceOrientationPortrait || (orientation) == UIDeviceOrientationPortraitUpsideDown)
#define UIDeviceOrientationIsLandscape(orientation) ((orientation) == UIDeviceOrientationLandscapeLeft || (orientation) == UIDeviceOrientationLandscapeRight)
UIKIT_CLASS_AVAILABLE(2_0) @interface UIDevice : NSObject {
@private
NSInteger _numDeviceOrientationObservers;
float _batteryLevel;
struct {
unsigned int batteryMonitoringEnabled:1;
unsigned int proximityMonitoringEnabled:1;
unsigned int expectsFaceContactInLandscape:1;
unsigned int orientation:3;
unsigned int batteryState:2;
unsigned int proximityState:1;
} _deviceFlags;
}
(UIDevice *)currentDevice;
@property(nonatomic,readonly,retain) NSString *name; // e.g. "My iPhone"
@property(nonatomic,readonly,retain) NSString *model; // e.g. @"iPhone", @"iPod touch"
@property(nonatomic,readonly,retain) NSString *localizedModel; // localized version of model
@property(nonatomic,readonly,retain) NSString *systemName; // e.g. @"iOS"
@property(nonatomic,readonly,retain) NSString *systemVersion; // e.g. @"4.0"
@property(nonatomic,readonly) UIDeviceOrientation orientation; // return current device orientation. this will return UIDeviceOrientationUnknown unless device orientation notifications are being generated.
@property(nonatomic,readonly,retain) NSString *uniqueIdentifier __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_5_0); // a string unique to each device based on various hardware info.
@property(nonatomic,readonly,getter=isGeneratingDeviceOrientationNotifications) BOOL generatesDeviceOrientationNotifications;
- (void)beginGeneratingDeviceOrientationNotifications; // nestable
- (void)endGeneratingDeviceOrientationNotifications;
@property(nonatomic,getter=isBatteryMonitoringEnabled) BOOL batteryMonitoringEnabled __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); // default is NO
@property(nonatomic,readonly) UIDeviceBatteryState batteryState __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); // UIDeviceBatteryStateUnknown if monitoring disabled
@property(nonatomic,readonly) float batteryLevel __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); // 0 .. 1.0. -1.0 if UIDeviceBatteryStateUnknown
@property(nonatomic,getter=isProximityMonitoringEnabled) BOOL proximityMonitoringEnabled __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); // default is NO
@property(nonatomic,readonly) BOOL proximityState __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); // always returns NO if no proximity detector
@property(nonatomic,readonly,getter=isMultitaskingSupported) BOOL multitaskingSupported __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
@property(nonatomic,readonly) UIUserInterfaceIdiom userInterfaceIdiom __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2);
- (void)playInputClick __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_2); // Plays a click only if an enabling input view is on-screen and user has enabled input clicks.
@end
@protocol UIInputViewAudioFeedback <NSObject>
@optional
@property (nonatomic, readonly) BOOL enableInputClicksWhenVisible; // If YES, an input view will enable playInputClick.
@end
UIKIT_EXTERN NSString *const UIDeviceOrientationDidChangeNotification;
UIKIT_EXTERN NSString *const UIDeviceBatteryStateDidChangeNotification __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
UIKIT_EXTERN NSString *const UIDeviceBatteryLevelDidChangeNotification __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
UIKIT_EXTERN NSString *const UIDeviceProximityStateDidChangeNotification __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
#import "sys/utsname.h"//記得加入此行
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0) {
// iOS 5 code
//代碼範例使用的是navigation中更改背景圖的方法,ios4以前使用的方法很多種,但蘋果希望目前使用這種方法,故以前的某些方法會被禁用
[self.navigationController.navigationBar setBackgroundImage:[UIImageimageNamed:@"top_bk.png"] forBarMetrics:UIBarMetricsDefault];
}
else {
// iOS 4.x code
}
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone) {
UIViewController* IPhoneViewController1=[[UIViewController alloc]init];
self.window.rootViewController= IPhoneViewController1;
}
else if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPad)
{
UIViewController* IPadViewController1=[[UIViewController alloc]init];
self.window.rootViewController= IPadViewController1;
}
[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
