Add this to your {App}-prefix.pch file
#ifndef __OPTIMIZE__
# define NSLog(…) NSLog(__VA_ARGS__)
#else
# define NSLog(…) {}
#endif
__OPTIMIZE__ only be set on release of build your app.
Add this to your {App}-prefix.pch file
#ifndef __OPTIMIZE__
# define NSLog(…) NSLog(__VA_ARGS__)
#else
# define NSLog(…) {}
#endif
__OPTIMIZE__ only be set on release of build your app.
before you run this script, you should had ruby env and Xcode.
1. save it with name ‘png’
2. chmod +x png
useage: ./png [ipa file path]
#!/usr/bin/env ruby -wKU require 'rubygems' ipa = ARGV.first puts "useage:png" and return if !ipa or ipa.end_with?("ipa") name = File.basename(ipa, ".ipa") # create output folder in you desktop output = "#{ENV['HOME']}/Desktop/#{name}" system %Q{mkdir -p "#{output}" && unzip "#{ipa}" -u -d "#{output}"} Dir.glob(File.join(output, "**", "*.png")).each do |f| system %Q{/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -revert-iphone-optimizations -q "#{f}" "#{File.join(output ,File.basename(f))}"} end system %Q{find '#{output}' -type f -not \\( -iname "*.png" -or -iname "*.jpg" -or -iname "*.jpeg" \\) -delete} system %Q{open "#{output}" -a finder}
CALayer *touchedLayer = [self.view layer]; // here is an example wiggle CABasicAnimation *wiggle = [CABasicAnimation animationWithKeyPath:@"transform"]; wiggle.duration = 0.1; wiggle.repeatCount = 1e100f; wiggle.autoreverses = YES; wiggle.toValue = [NSValue valueWithCATransform3D:CATransform3DRotate(touchedLayer.transform,0.1, 0.0 ,1.0 ,2.0)]; // doing the wiggle // [touchedLayer addAnimation:wiggle forKey:@"wiggle"];
1. change you <ProjectName>-info.plist to Info.plist
2. edit Info.plist, add item named “Localized resources can be mixed” as “checked”
3. create string file named “InfoPlist.strings”, make file localizable, add “zh-hans” or “zh-hant” locations for Simple Chinese and Traditional Chinese
4. put follow string in it.
CFBundleDisplayName = "xxxxx";
5. rebuild you application and run it.
# Ruby on Rails *.tmproj tmp/**/* config/database.yml config/*.sphinx.conf db/sphinx/**/* db/schema.rb log/* # Mac OS X Finder and whatnot .DS_Store # XCode (and ancestors) per-user config (very noisy, and not relevant) *.mode1 *.mode1v3 *.mode2v3 *.perspective *.perspectivev3 *.pbxuser # Generated files VersionX-revision.h # build products build/ *.[oa] # Other source repository archive directories (protects when importing) .hg .svn/*/** CVS # automatic backup files *~.nib *.swp *~ *(Autosaved).rtfd/ Backup[ ]of[ ]*.pages/ Backup[ ]of[ ]*.key/ Backup[ ]of[ ]*.numbers/
做了一个ruby脚本,自动生成该模板
#!/usr/bin/env ruby
require "rubygems"
content = <<-TEMPLATE
# Ruby on Rails
*.tmproj
tmp/**/*
config/database.yml
config/*.sphinx.conf
db/sphinx/**/*
db/schema.rb
log/*
# Mac OS X Finder and whatnot
.DS_Store
# XCode (and ancestors) per-user config (very noisy, and not relevant)
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser
# Generated files
VersionX-revision.h
# build products
build/
*.[oa]
# Other source repository archive directories (protects when importing)
.hg
.svn/*/**
CVS
# automatic backup files
*~.nib
*.swp
*~
*(Autosaved).rtfd/
Backup[ ]of[ ]*.pages/
Backup[ ]of[ ]*.key/
Backup[ ]of[ ]*.numbers/
TEMPLATE
system("echo '#{content}' > #{File.join(Dir.getwd, ".gitignore")}")