摘要:
@protocol UIApplicationDelegate<NSObject>@optional- (void)applicationDidFinishLaunching:(UIApplication *)application;//当程序完成载入后调用- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);//当程序完成载 阅读全文
摘要:
参考来源一:http://xiongzhend.blog.163.com/blog/static/64098501201041383342989/参考来源二: http://blog.iosxcode4.com/archives/23 iPhone可以使用CoreLocation框架确定他的物理位置,可以利用三种技术来实现该功能:GPS,WiFi定位和蜂窝基站三角网定位。但在程序中我们只需设定我们希望的精度级别,由CoreLocation决定采用哪种技术可以更好的满足我们的请求。1.Wi-Fi定位扫描本地路由器,使用它们的MAC地址搜索一个中心位置数据库,所有iPhone和iPod tou.. 阅读全文
摘要:
前期尝试过私有API,但是没有成功,还是用下面这个方法吧!获取IMEI:1 UIDevice *myDevice = [[UIDevice alloc] init];2 3 NSString *myimei = [myDevice imei];4 5 if (myimei.length!=15) {6 myimei = @"0000000000000000";7 }获取UID: UIDevice *device = [UIDevice currentDevice];//创建设备对象 NSString *deviceU... 阅读全文
摘要:
1 #import <UIKit/UIKit.h> 2 3 @interface UITestViewController : UIViewController <UIWebViewDelegate> 4 { 5 6 } 7 8 @end 9 10 11 //12 // UITestViewController.m13 // UITest14 //15 16 #import "UITestViewController.h"17 18 @implementation UITestViewController19 20 - (void)viewDidLo 阅读全文
摘要:
1 #import <UIKit/UIKit.h> 2 3 @interface UITestViewController : UIViewController <UIWebViewDelegate> 4 { 5 6 } 7 8 @end 9 10 11 12 13 //14 // UITestViewController.m15 // UITest16 //17 18 #import "UITestViewController.h"19 20 UIActivityIndicatorView *activity;21 22 @implementati 阅读全文
摘要:
- (void)viewDidLoad { [super viewDidLoad]; CGPoint frameCenter = self.view.center; float width = 50.0; float height = 50.0; CGRect viewFrame = CGRectMake(frameCenter.x-width,frameCenter.y-height, width*2, height*2); UIView *myView = [[UIView alloc] initWithFrame:viewFra... 阅读全文
摘要:
1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8 @implementation UITestViewController 9 10 11 - (void)buttonClick:(id)sender {12 13 NSLog(@"you clicked button: %@",[sender title]);14 }15 16 - (void)viewDidLoad {17 18 [super viewDidLoad];. 阅读全文
摘要:
1 // 2 // UITestViewController.h 3 // UITest 4 // 5 6 #import <UIKit/UIKit.h> 7 8 @interface UITestViewController : UIViewController <UITextViewDelegate> 9 { 10 11 } 12 13 @end 14 15 16 17 // 18 // UITestViewController.m 19 // UITest 20 // 21 22 #import "UITestViewController.h" 阅读全文
摘要:
1 // 2 // UITestViewController.h 3 // UITest 4 // 5 6 #import <UIKit/UIKit.h> 7 8 @interface UITestViewController : UIViewController <UITextFieldDelegate> 9 { 10 11 } 12 13 @end 14 15 16 17 18 // 19 // UITestViewController.m 20 // UITest 21 // 22 23 #import "UITestViewControll... 阅读全文
摘要:
1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8 @implementation UITestViewController 9 10 -(void)switchAction:(id)sender11 {12 NSLog(@"switch changed");13 }14 15 - (void)viewDidLoad {16 17 [super viewDidLoad];18 19 CGRect switchRect... 阅读全文
摘要:
1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8 UILabel *lblSliderValue; 9 10 @implementation UITestViewController11 12 -(void)sliderAction:(id)sender13 {14 int stepAmount = 10;15 float stepValue = (abs([(UISlider *)sender value]) / stepAmount... 阅读全文
摘要:
1 - (void)segmentClick:(id)sender 2 { 3 NSLog(@"you selected segment %d",[sender selectedSegmentIndex]); 4 } 5 6 - (void)viewDidLoad { 7 8 [super viewDidLoad]; 9 10 NSArray *arrSegments = [[NSArray alloc] initWithObjects:11 [NSString stringWithStrin... 阅读全文
摘要:
1 // 2 // UITestViewController.h 3 // UITest 4 // 5 6 #import <UIKit/UIKit.h> 7 8 @interface UITestViewController : UIViewController <UIScrollViewDelegate> 9 {10 11 }12 13 @end14 15 16 17 //18 // UITestViewController.m19 // UITest20 //21 22 #import "UITestViewController.h"23 24 阅读全文
摘要:
1 #import <UIKit/UIKit.h>2 3 @interface UITestViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>4 {5 6 }7 8 @end 1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8 NSMutableArray *comp1; 9 NSMutableArray *com 阅读全文
摘要:
1 #import <UIKit/UIKit.h>2 3 @interface UITestViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>4 {5 6 }7 8 @end 1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8 @implementation UITestViewController 9 10 - 阅读全文
摘要:
1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8 UIScrollView *myScrollView; 9 UIPageControl *myPageControl; 10 11 @implementation UITestViewController 12 13 - (void)loadScrollViewWithPage:(UIView *)page 14 { 15 int pageCount = [[myScrol... 阅读全文
摘要:
- (void)viewDidLoad { [super viewDidLoad]; CGRect labelFrame = CGRectMake(10,10,200,44); UILabel *myLabel = [[UILabel alloc] initWithFrame:labelFrame]; myLabel.backgroundColor = [UIColor clearColor]; myLabel.textColor = [UIColor redColor]; myLabel.font = [UIFont fontWithNam... 阅读全文
摘要:
- (void)viewDidLoad { [super viewDidLoad]; UIImage *anImage = [UIImage imageNamed:@"apple.png"]; UIImageView *myImageView = [[UIImageView alloc] initWithImage:anImage]; [[self view] addSubview:myImageView]; //scale our height and width by 50% CGSize viewSize = myIma... 阅读全文
摘要:
#import "UITestViewController.h"@implementation UITestViewController- (void)pickerChanged:(id)sender{ NSLog(@"value: %@",[sender date]);}- (void)viewDidLoad { [super viewDidLoad]; CGRect pickerFrame = CGRectMake(0,120,0,0); UIDatePicker *myPicker = [[UIDatePicker alloc] initW... 阅读全文
摘要:
#import "UITestViewController.h"@implementation UITestViewController-(void)buttonDown:(id)sender{ NSLog(@"Button pushed down");}-(void)buttonRelease:(id)sender{ NSLog(@"Button released");}-(void)checkboxClick:(UIButton *)btn{ btn.selected = !btn.selected;}- (void)viewDi 阅读全文