最近遇到了两次电脑(RMBP)插入耳机后耳机无声的问题,第一次重启解决,第二次不想重启,在做了一番搜索尝试后,最终的有效方案是重新加载下驱动。在终端执行如下命令即可:

1
2
sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext

希望可以帮到有类似烦恼的人。

Solution for No Sound When Plug in Your Headphones to Mac

Recently met twice headphones silent problem when plug in my Headphones to my RMBP. I solved the first one with a reboot, but I don’t want to reboot the second time. I did some google, the final effective solution is to reload the drive. Run the following command in terminal fix my issue:

1
2
sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext

Hope this can help you.

Recently I have open-sourced my projectTCTitleLoading and made it supporting Cocoapods. Below is the procedure.

1. Create Your Project and Submit It to Github

Create your project and submit it to Github,Record the address for later useage, for example:https://github.com/TravelC/TCTitleLoading.git

2. Create a Branch for Cocoapods

Create a branch for Cocoapods. Naming it with version number is recommended, e.g.‘0.0.1’

阅读全文 »

话不多说,上代码:

1
2
3
NSString *test=@"2015/11/12;*1-年2+3年月";
NSString *newString = [[test componentsSeparatedByCharactersInSet: [[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""];
NSLog(@"%@", newString);