// 一个按钮点击事件,判断点击按钮是那一个显示出他的信息- (IBAction)buttonPressed:(id)sender { if (sender == self.leftButton) { NSLog(@"%@", self.leftButton.currentTit...
分类:
其他好文 时间:
2014-07-16 18:19:06
阅读次数:
167
- (NSString *)getLocalIP{
struct sockaddr_in sa;
socklen_t len = sizeof(sa);
if(getsockname(sockfd, (struct sockaddr *)&sa, &len))
{
NSLog(@"获取失败!");
}
return [NSS...
分类:
移动开发 时间:
2014-07-16 17:24:41
阅读次数:
238
//当我们的事件开始的时候调, 对于touch来说, 实际上当手指头放到屏幕上的时候,这个方法会被调用- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ NSLog(@"%s",__func__);}//当我们手指点击屏...
分类:
其他好文 时间:
2014-07-16 15:29:56
阅读次数:
190
#ifndef __OPTIMIZE__#define NSLog(...) NSLog(__VA_ARGS__)#else#define NSLog(...){}#endif打开Xcode -->>product -->scheme -->>edit scheme -->info 设置debug ...
分类:
移动开发 时间:
2014-07-14 21:08:29
阅读次数:
262
获取屏幕尺寸[[[UIScreen mainScreen] currentMode].size.width];[[[UIScreen mainScreen] currentMode].size.height];也能够:NSLog(@"FrameHeight:%fFrameWidth:%f",self...
分类:
移动开发 时间:
2014-07-09 14:53:40
阅读次数:
213
-(NSArray *)getdataFromDatabase
{
NSString *path = [self getDBPath];
NSLog(@"path ==== %@",path);
NSLog(@"self.getDBPath == %@",[self getDBPath]);
FMDatabase *membersDB = [FMDatab...
分类:
其他好文 时间:
2014-07-08 13:07:44
阅读次数:
127
// First program example#import int main (int argc, const char * argv[]) { @autoreleasepool { NSLog (@"Programming is fun!"); } return...
分类:
其他好文 时间:
2014-07-06 13:03:34
阅读次数:
177
1、判断字符串是否包含某个字符
if( [str rangeOfString:@"hello"].location != NSNotFound) {
NSLog(@"yes");
} else {
NSLog(@...
分类:
移动开发 时间:
2014-07-06 11:18:41
阅读次数:
226
Obj-C只是增加了一点“特殊语料”的C语言,所以可以用printf()代替NSLog()。但我们建议使用NSLog,因为它添加了特性,例如时间戳,日期戳和自动附加换行符(‘\n’)等。1.OC的数组成员是任意的对象指针 与C中的链表结构类似(以nil结尾) 一切的数组操作不能越界OC的数组分为.....
分类:
其他好文 时间:
2014-07-05 22:33:03
阅读次数:
341
iOS开发中常用的数学函数 /*---- 常用数学公式 ----*/ //指数运算 3^2 3^3 NSLog(@"结果 %.f", pow(3,2)); //result 9 NSLog(@"结果 %.f", pow(3,3)); ...
分类:
移动开发 时间:
2014-07-05 22:01:45
阅读次数:
390