xcode4.5

avoid Headset plugout stops AVAudioPlayer in iOS

ぃ、小莉子 提交于 2019-12-12 08:10:13
问题 In my iPhone app I am using AVAudioPlayer to play the songs...But when I plug out or plugin the headset during song playing, It automatically stops the AVAudioPlayer... I need to run audio player even though these changes occur.. any ideas will be appreciated.Thanks in advance. 回答1: First, you have to tell AVAudioSession the audio behaviour of your app. Apple name this the audio session category , an can be set by [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback

Set progress bar for downloading NSData

我只是一个虾纸丫 提交于 2019-12-12 07:36:29
问题 NSURL *url = [NSURL URLWithString:@"http://i0.kym-cdn.com/entries/icons/original/000/005/545/OpoQQ.jpg?1302279173"]; NSData *data = [NSData dataWithContentsOfURL:url]; imageView.image = [[[UIImage imageWithData:data]; I want to set progress bar while downloading. 回答1: To give a more detailed example: in your .h file do @interface YourClass : YourSuperclass<NSURLConnectionDataDelegate> in your .m file do @property (nonatomic) NSMutableData *imageData; @property (nonatomic) NSUInteger

XCode 4.5 - Undefined symbols for architecture armv7

Deadly 提交于 2019-12-12 04:44:45
问题 I'm brand new to iOS development, and I've been given the task of updating a legacy app to iOS6. The app was built with Unity. In XCode 4.5, when I try to run the Unity-iPhone app on my device (iPhone 4), I get this error: Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device. I went to the build settings for the target, and noticed that armv6 was set for architectures and valid architectures. I changed both of these

Can't see IBOUTLETs when using StoryBoard with ZBARReaderView

冷暖自知 提交于 2019-12-12 04:32:53
问题 I am trying to write the embedded reader example in ZBar SDK using a story board and not NIB files. I Declare my IBOutlets as so: @interface MYQViewController : UIViewController < ZBarReaderViewDelegate > { ZBarReaderView *readerView; UITextView *resultText; } @property (strong, nonatomic) IBOutlet ZBarReaderView *readerView; @property (strong, nonatomic) IBOutlet UITextView *resultText; @end However when I create a ZBarReaderView View Controller on the main UIView and try click and drag to

How to link or load shared libraries (.so) in Objective C?

烈酒焚心 提交于 2019-12-12 03:53:31
问题 I added a shared library (.so) to target in the Build Phases.How to use the functions in the library? Including the headers in the Controllers is fine. or do I need to explicitly load the library.Please let me know how to use .so in Objective C. 来源: https://stackoverflow.com/questions/15784593/how-to-link-or-load-shared-libraries-so-in-objective-c

OCUnit test cases not running

家住魔仙堡 提交于 2019-12-12 02:56:43
问题 If I create a new project which includes unit tests, the test cases get called. But when I'm adding tests to an existing project I'm getting the following in the log: 2013-05-21 19:41:08.814 otest[51593:7e03] Unknown Device Type. Using UIUserInterfaceIdiomPhone based on screen size Test Suite '/Users/impadmin/Library/Developer/Xcode/DerivedData/SmartDiary-frrybdtgyyjgewbialqsmxkwvlxs/Build/Products/Debug-iphonesimulator/testSmartDiary.octest(Tests)' started at 2013-05-21 14:11:09 +0000 Test

How to make the UIView function like UIScrollView (Objective-C)

北城余情 提交于 2019-12-12 02:29:31
问题 I have a class named Topic . And inside that topic I can create (and delete) Messages . I need to show the messages in a view that can be scrolled/swiped either right or left (Right to show the older messages, and left to go back to the newer messages). Imagine an image collection that can be scrolled sideways in a ScrollView , that how this should look like. Since the messages is being add by the user, I can't use UIImage . I am thinking of the approach that I need to add use UIView instead

Master Detail Application for iPad

[亡魂溺海] 提交于 2019-12-12 02:22:12
问题 I am creating an iPad version of Master Detail Application using XCode 4.5 with ARC. I have my iPadMaster.h/.m(as my master) and iPadDetailViewController.h/m(as my detail) set up. I am trying to load different view controllers from iPadDetailViewController when users click/select the rows on iPadMaster. I set this on iPadMaster.m at: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { iPadDetailViewController * DVC = [[iPadDetailViewController alloc

Facebook iOS SDK FRAMEWORK_SEARCH_PATH

泪湿孤枕 提交于 2019-12-12 01:36:37
问题 I am using Facebook iOS SDK 3.5 in my ipad App. I added framework, setup everything and everything is working fine. But when I copied my project source code to some other place other than where it is currently and build the project again, I get an XCode Apple Mach-O Linker Warning as directory not found [CURRENT_APPLICATION_PATH]/../../FacebookSDK. After searching for sometime, I found out that in XCode Build Settings, FRAMEWORK_SEARCH_PATHS has a path as "$(SRCROOT)/../../FacebookSDK" which

Accessing a database in Xcode

与世无争的帅哥 提交于 2019-12-12 01:34:01
问题 What is the best way to access a database in Xcode? I am attempting to build an app that requires people to login with correct credentials and get certain data from the server and display it in the app. Is there a way to write SQL in Xcode without it underlining red? To login would I access the php file with the login script? I am not asking how, I just want some advice and some useful tips and pointers in the right direction/any useful resources for what I am trying to do? Thanks for your