Mac Finder 使用技巧 @ 6/25/2011

mac

1. 不同的视图模式的选择
使用快捷键 切换 显示模式
Command-1 (icon view)
Command-2 (list view)
Command-3 (column view)
Command-4 (cover flow)
ps: 好多人都使用column view模式 且在目标上加上一些不同颜色的label标识 算是不错的使用习惯

2. 在窗口底部显示层级目录名称
View -> Show Path bar
双击目录名称可以直接进入相应的目录; 拖文件也可以直接拖进去

3. 除了上面的方法,还有另外一种方法可快速显示/进入父级目录
Control(/Command)+点击窗口最上面中间的当间目录名称, 将显示层级目录菜单

4. 拖动文件技巧,拖动文件到一个目录上停住几秒后将打开该目录,如果使用 空格键 将立即打开该目录; 使ESC键将取消操作

5. 让Finder窗口上面的标题显示全路径
打开~/Library/Preferences/com.apple.finder.plist 文件,将_FXShowPosixPathInTitle 改为YES
或者使用命令:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

最后执行命令:
killall Finder

ps: 似乎意义不大,不能复制与粘贴





发布于 6/25/2011 19:44:34 | 评论:2

Three20框架中使用TabBarController的问题 @ 4/18/2011

iOS
使用Three20框架且使用TabBarController, 在每个Tab中使用TTNavigationController. 但有5以上Tab时,更多 选项卡中的详细将不能正确打开。

google到这是一个09年的BUG,现在也没有修复
http://groups.google.com/group/three20/browse_thread/thread/af2c5890e5e03fc1

@RoBak42发表:
I think, it is a problem with the additional moreNavigationController
which is used when more than 5 tabs are used.
When I put the marked lines (see ("// v--- from here" ...  "// ^-- to
here" below)
in TTNavigator.m's parentForController:parent: method,
it works a little bit better. Nevertheless I am sure it doesn't fix
the problem really,
but I hope it is a hint for someone, who completly understands what's
going on and is able to fix it.
- (UIViewController*)parentForController:(UIViewController*)controller
parent:(NSString*)parentURL {
  if (controller == _rootViewController) {
    return nil;
  } else {
    // If this is the first controller, and it is not a "container",
forcibly put
    // a navigation controller at the root of the controller
hierarchy.
    if (!_rootViewController && ![controller canContainControllers]) {
      [self setRootViewController:[[[UINavigationController alloc]
init] autorelease]];
    }
    if (parentURL) {
      return [self openURL:parentURL parent:nil animated:NO];
    } else {
      UIViewController* parent = self.topViewController;
      // v--- from here
      if ([parent isKindOfClass:[UINavigationController class]]) {
        if (parent.parentViewController != nil)
          parent = parent.parentViewController;
        if ([parent isKindOfClass:[UITabBarController class]]) {
          parent = [(UITabBarController*)parent
moreNavigationController];
        }
      }
      // ^---- to here
      if (parent != controller) {
        return parent;
      } else {
        return nil;
      }
    }
  }
}


@Skotch:
1. I can navigate to the first level items on the more menu, but if I
try to navigate deeper it doesn't seem to work. [solved by your
change]
2. If I have a more menu, and I enter into a item on the more menu,
then the first icon on my tab bar now seems to show both icons. [not
solved]
3. Also, if I exit the app, then the code that tries to restore state
gets confused, and it isn't able to reopen the item under the more
menu. [not solved]
Your change definitely solves the first one, but as you suggested, is
not sufficient. If there is anyone who understand this code, please
look into fixing this. Otherwise, I am avoiding the more menu for
now.


分析了很久,
修改了@RoBak42的一行代码搞定:

if ([parent isKindOfClass:[UITabBarController class]]) {
                parent = [[(UITabBarController *)parent moreNavigationController] topViewController];
            }


发布于 4/18/2011 21:17:46 | 评论:0

iPhone/iPad apps的图标及启动图片 @ 4/6/2011

iOS

参考下面的表格,相关参数已更新到iOS4.3及Xcode4:



Typical icons are PNG files with 90 degree corners, but no transparency, no layers, and set to 72 PPI.  iPhone OS applies rounded corners, optionally shine, and other effects. If you have added these effects let your programmers know it. When you do not let the iPhone/iPad OS to apply the gloss to your icons, developers must add a key to info.plist called UIPrerenderedIcon and make it checked. The standard bit depth is 24 bits + 8-bit alpha channel.
Designers and programmers alike understand now that the sizes of items on iPhone/iPad screens are not constants. Differences in screen size and zoom functionality are common place, but PNG format and 72 PPI is still the default. (PNG discards pixel density. Most image editors, including Adobe Photoshop, assume that an image’s pixel density is 72 if the information is not stored.)
iPad icons can be tricky. Some designers release the standard iPad icons only but fail to include some crisp small size icons as options for OS. Add some tiny iPad icons to your project in the sizes of 64×64, 32x32px, 24x24px and 16x16px. Programmers know how to include these files (see Info.plist).
You should know that when the user taps on the main application icon the app immediately starts to load. It’s important to make the launch time as short as possible. Every iPhone/iPad app should ship with a launch image which mimicks the interface by using a static image. The launch image should be as small a file as possible to ensure quick loading. Do not create image files in the megabyte territory.
Notes for developers:
In the Info.plist file developers specify the orientations the application supports along with the related launch images. If missing, they must add these lines:

    <key>UISupportedInterfaceOrientations</key>   
    <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationPortraitUpsideDown</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
    </array>

Developers may change previous naming conventions, as we did, and use their own custom name of icon and launch image files. We usually want to configure our iPad applications differently from iPhone versions, so we specify device-specific values for Info.plist keys. For example:

Sample icon and launch image settings in Info.plist for universal applications. Platform: iOS 3.2+
iOS documentation: “The image files used to represent icons and launch images must all reside in the root level of your bundle. How you identify these images to the system can vary, but the recommended way to specify your application icons is to use the CFBundleIconFiles key… In addition to the icons and launch image at the top level of your bundle, you can also include localized versions of those images in your application’s language-specific project subdirectories”. The filenames can be anything you want, but all image files must be in the PNG format.
1. If your iPhone application supports running in iOS 3.1.x or earlier, you cannot use the CFBundleIconFiles key to specify your icon files. You must create icons of the same size as listed in our table, but each image must be named as follows:
Icon.png – Application icon on iPhone or iPod touch
Icon-72.png – iPad application icon in a Universal application
Icon-Small.png - Search results and Settings icon on iPhone and iPod touch
Icon-Small-50.png – Search results in iPad applications
Since version 3.2 if you specify an Icon-Small.png or Icon-Small-50.png file in your bundle, the system prefers those icon files over the ones in the CFBundleIconFiles key and the iOS prefers the application icon defination in the CFBundleIconFiles key over any other one.
2. The iOS is finally making the move into resolution independence and your image objects aren’t measured in pixels, but in points. Points don’t always correspond to pixels. The screen size of the iPhone 3 is 480×320, in both points an pixels. The iPhone 4′s screen size is 960×640 in pixels, but its logical screensize still remains at 480×320 in points. Keep your frame, point and size values in their original values and still support larger resolution devices. On iPhone 4 you may insert “@2x” in the name of the image file and it will be used automatically on the higher resolution devices. Use like “button1back@2x.png”. The simulator of XCode 3.2.6 still reports screen size of 320×480, but see what you have done… on a hires device.
Check out UIScreen class reference for properties of bounds and currentMode. The bounds property gives us the rectangle of the screen in points.The currentMode.size property represents the screen size in pixels. For example, since iOS 4, [UIImage imageWithContentsOfFile: ] recognises when an image has the ’2x’ version and displays it correctly.
3. In the Info.plist, at the CFBundleIconFiles key, if you do not specify the filename extensions for launch and icon images, you can avoid listing all of the 2x variations, and the Info.plist would look like this:

Sample icon image settings in Info.plist for universal applications. Platform: iOS 4+

iOS 4+ comment: As you can see, the hi-res version of the same launch image should be named launchimage@2x.png. If you did not specify a custom launch image name, these files must be named Default.png and Default@2x.png, respectively. If you include a filename extension, you must explicitly add the names of all image files. For universal iPhone/iPad apps the orientation-specific launch image filenames can be as follows:
<basename><orientation_modifier:-Portrait or -Landscape><scale_modifier: @2x><device_modifier: ~ipad or ~iphone>.png , like

launchimage-Portrait.png,
launchimage-Portrait@2x.png,
launchimage-Portrait~ipad.png,
launchimage-Landscape~ipad.png...

If you do not specify a custom launch image filename, you must use the names of Default-Landscape.png and Default-Portrait.png.


发布于 4/6/2011 18:27:42 | 评论:0

解决Xcode 4“xxx does not contain a single–bundle application or contains multiple products” archive错误 @ 4/6/2011

iOS

采用了cocos2d, three20等第3方库会有这样的问题。

原因是:
Xcode 4 重新编译静态库同时把它做为可部署的产品打包到程序包中, 而一般程序包只能包含一个可部署的产品。

1. 打开静态库项目. 在Build Settings中找到 Deployment Group

在项目导航区选择依赖项目
2. 找到 Skip Install 并修改为YES

Dependent project's settings in Xcode 4

3. 如果有多个依赖项目,重复上面的设置。

注意:
- 主App是需要部署的所以不要将Skip Install设为YES, 只需要改依赖项目。

发布于 4/6/2011 15:53:02 | 评论:0

怎样在Xcode 4下编译发布与提交App到AppStore? @ 4/6/2011

iOS

1. iOS Provisioning Portal 和iTunes Connect 没有变,下载与安装.mobileprovision文件与以前一下。

2. Xcode 4 整合相关的工具(All in One), 集成了Organizer与Application Loader.
Xcode4多了Run/Build Scheme的概念,指以前的编译的选项如 device/simulator, iOS version等。
发布应用时需要选择iOS Device:

选择 应用target及'iOS Device'

点击 Edit Scheme... 以编辑Archive选项,它的默认 编译配置为Release 并且 将归档显示在Organizer中:

修改scheme

3. 检查 编译配置文件:product name, info.plist, version, Target Device Family, iOS Deployment Target, Code Signing Identity etc. (这与Xcode 3.x一致)。

4. 进入Product菜单->Archive, 然后会自动弹出Organizer

Archive包是用来上传到AppStore的

Xcode4让你不需要关心编译发布的程序包在哪里,只需要在Organizer中管理即可。
当然你可以在XCode->Preferences->Locations tab配置程序的存储位置。

5. 在Organizer中选择 Archive, 验证与上传。

Validate and submit your app to AppStore

6. 成功上传App之后,Archive状态会变为 已提交。

注意:
Organizer中“Share Application” 是发布hoc包 ,将会生成一个.ipa文件,可用于真机测试。
发布于 4/6/2011 15:24:01 | 评论:2

Xcode4设置NSZombieEnabled @ 3/30/2011

iOS

按住Alt/Option, 点Run or Test...

->Arguments tab, 在 "Environment Variables"里 增加 NSZombieEnabled YES
CFZombieLevel YES
发布于 3/30/2011 20:05:23 | 评论:0

一些iOS开源类库及工具 @ 3/24/2011

iOS
1.json json编码解码
2.GTMBase64 base64编码解码
3.TouchXML xml解析
4.SFHFKeychainUtils 安全保存用户密码到keychain中
5.MBProgressHUD 很棒的一个加载等待特效框架
6.ASIHTTPRequest http等相关协议封装
7.EGORefreshTableHeaderView 下拉刷新代码
8.AsyncImageView 异步加载图片并缓存代码
9.类似setting的竖立也分栏程序
10.http://getsharekit.com/
11.sqlitepersistentobjects
12. JSONKit - A brand new (and insanely fast) JSON Library
13. Mogenerator - Generate classes from core data models
14. UIDickbar - In case you'd like to improve the experience of your iOS apps.
15. MyStyledView - A great base for styling views in AppKit.
16. JAListView - A UITable-inspired NSTableView replacement for AppKit.


AppStore软件排名相关,工欲善其事,必先利其器。

1.下载排名相关:appannie
2.用户行为分析:flurry
3.majicrank-各国排名查询工具
4.AppViz-App销售统计软件
5.PodViz-用户评论等查看工具
6.appfigures-报表统计分析工具
7.一个帮助开发者推广app的评测站:苹果I派党

发布于 3/24/2011 9:49:27 | 评论:0

Xcode 4 @ 3/17/2011

iOS

差别好大,过去的经验成了障碍...

Xcode 4 is fundamentally different from its predecessors, so whether you're new to Apple platforms or an experienced Apple developer, you should read  the first couple of chapters to learn about Xcode 4.

Reading...
发布于 3/17/2011 20:49:06 | 评论:0

CodeIgniter Nginx Config @ 3/12/2011

shell&peal&php&c
增加rewrite

server {
    listen      80;
    server_name  test.local;

    location / {
        root  /data/www/test;
        index  index.html index.htm index.php;
        rewrite ^/$ /index.php last;
        rewrite ^/(?!index\.php|robots\.txt|images|js|styles)(.*)$ /index.php/$1 last;
    }

    location ~ ^(.+\.php)(.*)$ {
        root  /data/www/test;
        fastcgi_index  index.php;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO      $fastcgi_path_info;
        fastcgi_param  PATH_TRANSLATED $document_root$fastcgi_path_info;
        //fastcgi_pass    unix:/tmp/php-fpm.sock;
fastcgi_pass  127.0.0.1:9000;
        include fastcgi_params;
    }
}
发布于 3/12/2011 10:35:53 | 评论:0

XCode GDB commands @ 3/12/2011

iOS
>po object
- ask object to print itself

>break or b
- stop at a break point

>cont
- continue after a break

>next
- step over

>step
- step into

>finish
- step out of a present function

>up
- Move to the function that called the present function. Useful if your program crashes in a library function; use up to get to the last function call in your program.

>down
- Reverses the action up

>kill
- Terminate the program
发布于 3/12/2011 10:10:18 | 评论:2
Loading...


撩乱的城市...
midnight...

Free HTML Hit Counters

Dict.CN 在线词典, 英语学习, 在线翻译
categories
recent comments
archives
links
statistics
  • 网志数:484
  • 评论数:648