案外知られていないマクロなので、念のため。 こんな感じにログに埋め込んでおくと、ファイル名とライン行が出力されて便利。
DLog(@"Error:%s:%d",__FILE__,__LINE__);
下記のように#defineに定義してもよいが、処理系によってはマクロの多重展開がうまくいかない場合があるので、必ずテストすること
#define LOG( _x_ ) printf("%s:%d->%s\n",__FILE__,__LINE__,_x_)
| JSObject *object = JS_NewObject(_cx, NULL, NULL, NULL ); | |
| JSBool result = JS_TRUE; | |
| std::map< std::string, std::string >::const_iterator it = params.begin(); | |
| while(it != params.end()){ | |
| CCLOG("%s => %s",it->first.c_str(), it->second.c_str()); | |
| JSString* jsValue = JS_NewStringCopyN(_cx, it->second.c_str(), it->second.length()); | |
| result &= JS_DefineProperty(_cx, object, it->first.c_str(), STRING_TO_JSVAL(jsValue), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT); | |
| ++it; | |
| } |
| NSString* q = @"http://maps.apple.com/maps?q='渋谷駅'"; | |
| NSURL* url = [NSURL URLWithString:[q stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; | |
| [[UIApplication sharedApplication] openURL:url]; |
| dispatch_group_t group = dispatch_group_create(); | |
| [self.arrayLocalSearch removeAllObjects]; | |
| NSError* error = nil; | |
| NSFetchRequest* fetchRequest = [[NSFetchRequest alloc] init]; | |
| NSEntityDescription* entity = [NSEntityDescription entityForName:@"Location" | |
| inManagedObjectContext:[MapData sharedManager].managedObjectContext]; | |
| [fetchRequest setEntity:entity]; |
| NSSortDescriptor* sortDescriptorWithName = [[NSSortDescriptor alloc] initWithKey:@"name" | |
| ascending:YES]; | |
| NSArray* aSortDescriptor = @[sortDescriptorWithName]; | |
| [fetchRequest setSortDescriptors:aSortDescriptor]; | |
| NSPredicate* predicate = [NSPredicate predicateWithFormat:@"status >= 0"]; | |
| [fetchRequest setPredicate:predicate]; | |
| NSFetchedResultsController* fetchedResultsController = |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| //3.5inchと4inchを読み分けする | |
| CGRect rect = [UIScreen mainScreen].bounds; | |
| if (rect.size.height == 480) { | |
| UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"3_5_inch" bundle:nil]; | |
| UIViewController* rootViewController = [storyboard instantiateInitialViewController]; | |
| self.window.rootViewController = rootViewController; | |
| } |
| PROJECT_PATH = "../cocos2d/build/cocos2d_libs.xcodeproj" | |
| TARGET_NAME="'build all libs iOS'" | |
| OUTPUT_DEBUG="tmp/iphonesimulator" | |
| OUTPUT_RELEASE="tmp/iphoneos" | |
| OUTPUT_LIB="../lib" | |
| desc "静的ライブラリをビルドします" | |
| task "lib" do | |
| sh "xcodebuild -project #{PROJECT_PATH} -configuration Release -sdk iphonesimulator7.1 -target #{TARGET_NAME} TARGET_BUILD_DIR=../../build/#{OUTPUT_DEBUG} BUILT_PRODUCTS_DIR=../../build/#{OUTPUT_DEBUG} clean build" |
案外知られていないマクロなので、念のため。 こんな感じにログに埋め込んでおくと、ファイル名とライン行が出力されて便利。
DLog(@"Error:%s:%d",__FILE__,__LINE__);
下記のように#defineに定義してもよいが、処理系によってはマクロの多重展開がうまくいかない場合があるので、必ずテストすること
#define LOG( _x_ ) printf("%s:%d->%s\n",__FILE__,__LINE__,_x_)