`
siruoxian
  • 浏览: 231771 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
for(UIView *view in [self.view subviews]){   [view removefromsuperview];}
NSURL *url=[NSURL URLWithString:@"http://..../Icons/icon.ico"];NSData *data=[NSData dataWithContentsOfURL:url];UIImage *tmpimage=[[UIImage alloc] initWithData:data]; UIImageView *imageview =[[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];imageview.image=tmpimage;[self.vi ...
[[SimpleAudioEngine sharedEngine] playEffect:@"花田错.mp3"];
基于手机 网络环境问题 在UIWebView控件使用的时候,程序习惯添加UIActivityIndicatorView用以控制UIWebview的加载等待,在等待的时间内用户不允许操作,所以我们还要在当前的UIWebview上添加一个透明的view(opaqueview)用以防止用户点击, ...

makeKeyAndVisible

每个程序都有方法: [window makeKeyAndVisible]; 由于iPhone是单窗口程序,所以也就只有这么一个Window对象,而且是UIWindow,不是NSWindow。而根据文档上所说: “这个是便捷方法,去使被使用对象的主窗口显示到屏幕的最前端。你也可以使用hiddenUIView方法隐藏这个窗口” 所以基本上来说,对于编程者的区别仅仅在于在其前添加代码,或在其后添加代码。
//获取密码+ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;//保存密码+ (void) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting e ...
 //跳转到下一组controller SelectLevelControllerView *_selectLevelControllerView=[[SelectLevelControllerView alloc] init];        [self.navigationController pushViewController:_selectLevelControllerView animated:NO];        [_selectLevelControllerView release]; //返回到顶级 controller [self.navigationControll ...

in AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {          // Override point for customization after application launch. MenuControllerView *_menuControllerView=[[MenuControllerView alloc] init]; UINavigationController *_rootNavigationContr ...

arc4random()

elementRand=arc4random()%9+2;
NSString *soundPath=[[NSBundle mainBundle] pathForResource:NSLocalizedStringFromTable([_dictionary objectForKey:@"sound"],[defaults stringForKey:@"language"],@"提示") ofType:@"mp3"];  NSURL *soundUrl=[NSURL fileURLWithPath:soundPath];  _player=[[AVAudioPlayer all ...

NSTimer 小示例

[NSTimer scheduledTimerWithTimeInterval:0.5target:self selector:@selector(yourmethod) userInfo:nil repeats:NO]
NSString *_tmpStr=[NSString stringWithFormat:@"%@",[_mainDictionary objectForKey:@"Describe"]];  Label.text=NSLocalizedStringFromTable(_tmpStr,[defaults stringForKey:@"language"],@"注意内容");

跳转到下一个VIEW

TestControllerView *_testControllerView =[[TestControllerView alloc] init];  [self.navigationController pushViewController:_testControllerView animated:NO];  [_testControllerView release];

UIView 用法示例

  [UIView beginAnimations:nil context:nil];  [UIView setAnimationDelay:0.8];  [UIView setAnimationDuration:6.5];  [UIView setAnimationCurve:UIViewAnimationCurveLinear];  [UIView setAnimationWillStartSelector:@selector(yourmethod)];  [UIView setAnimationDidStopSelector:@selector(yourmethod)];  [UIView ...

UIScrollView

_scrollView=[[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)]; _scrollView.directionalLockEnabled = YES; _scrollView.pagingEnabled = YES; [_scrollView setDelegate:self]; _scrollView.showsVerticalScrollIndicator = NO; _scrollView.showsHorizontalScrollIndicator = NO;
Global site tag (gtag.js) - Google Analytics