1. 使用此代码改变搜索栏“UITextField将backgroundImage
UITextField *searchField;
NSUInteger numViews = [searchBar.subviews count];
for(int i = 0; i < numViews; i++) {
if([[searchBar.subviews objectAtIndex:i] isK...
分类:
其他好文 时间:
2015-01-21 11:43:10
阅读次数:
181
1.NSNumber 是一个类继承于NSValue 即一个基本数据类型的集合 包括chara signed or unsigned char, short int, int, long int, long long int, float, or double or as a BOOLNSNumber...
分类:
移动开发 时间:
2015-01-19 18:44:02
阅读次数:
283
stringWithFormat用于返回一个带有格式控制符的字符串,是类方法length:返回一个NSUInteger类型,求字符串长度的值stringByAppendingString:将两个字符串拼接,返回一个新字符串stringByAppendingFormat:将原字符串与给定字符串拼接,给定字符串带有格式控制符,返回一个新字符串sub..
这个是我们学习OC过程中出现的各种奇怪ERROR,具体ERROR分类还没想好,先做成合集吧。当然 我会尽量回忆学习C时出现的ERROR,也做一个合集。第一个ERRORform:旗木*卡卡西require:定义?个block,返回值为NSInteger,有两个参数,?个是 NSArray,?个是NSS...
分类:
其他好文 时间:
2015-01-17 12:30:58
阅读次数:
199
NSMutableArray可变数组//initWithCapacity:创建一个数组//-(instancetype)initWithCapacity:(NSUInteger)numItemsNSMutableArray*array=[[NSMutableArrayalloc]initWithCapacity:1];//1表示刚开始给数组分配一个对象大小的内存,当数组已经有一个对象时,再放一个对象时,数组会..
1:先遵守UIAlertViewDelegate
2:- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex==0) {
NSLog(@"你点击了取消");
}else
if (buttonIndex=...
分类:
移动开发 时间:
2015-01-15 16:05:32
阅读次数:
172
首先在这个viewContoller里面设定只支持横向
//iOS 7 above
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
- (NSUInteger)supportedInterfaceOri...
分类:
移动开发 时间:
2015-01-14 12:47:33
阅读次数:
111
1.Person.h#import<Foundation/Foundation.h>@interfacePerson:NSObject{NSString*_name;NSString*_sex;NSInteger_age;CGFloat_weight;CGFloat_height;}-(void)sayhi;//设置器专门给一个实例变量赋值的方法-(void)setName:(NSString*)name;-(void)setSex:(NSString*)sex;..
分类:
其他好文 时间:
2015-01-13 01:31:49
阅读次数:
161
swfit中的String和Int是 struct定义的,不同于NSString和NSNumber, 如果想在一个数组中同时包含String和Int,那么这个数组要声明为[Any] 而不是 [AnyObject] , 因为他们不是class!另外,与c中的string和int 不同,swfit中的是...
分类:
编程语言 时间:
2015-01-12 12:51:15
阅读次数:
159
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if ([NSStringFromClass([[[window subviews]lastObject] class]) isEqualToString:@"...
分类:
移动开发 时间:
2015-01-09 17:26:42
阅读次数:
220