I'm trying to create an iPhone app which plays local radio station in my district. I found this player to work best for me :
https://github.com/DigitalDJ/AudioStreamer
When testing it against my requirements it did the best without any doubt.
I thought I'll use this players API and it should be straightforward(not really for a newbie). How exactly I do that is where I'm stuck now. Because when I run the player original project it runs smooth, but when I copy code inside Classes to my app, this is what happens :
Ok, I've been developing some apps(test apps) for two weeks maybe and I lack experience.
How do you usually embed/import other projects code into your code and user the other codes api?
EDIT
So per Sunil Pandey answer, this cannot be run using IOS SDK version 5.0?
EDIT 2 :
I feel like I'm really close now, have this one issue :
Receiver 'AudioStreamer' for instance message is a forward declaration
It's declared in my h file. as AudioStreamer *streamer
As said Sunil Pandey, ARC mecanism is enabled for your project. With ARC, your project require at least iOS4 on the phone.
I would suggest you to disable ARC for the file you imported from the third party librairy. So you can keep using ARC in your own code (this mean, you never use retain, release, autorelease).
To disable ARC for each file of your AudioStreamer library, refer to How can I disable ARC for a single file in a project?
You must have implemented ARC inside your project. that's why it is giving you this error.
If you are using ARC then only way to use this project library is to create a static library of your AudioStreamer lib and then import it inside your app
Or
If you don't want to use ARC inside your app then you can turn it off by following method
select your target -> Build Setting -> Apple LLVM Compiler 3.0 - Language
set Objective c Automatic Reference Counting to NO
Related
I have been looking for a packet/library with a file browsing capability for WebDAV, which I could use for my project in objective c, using xcode 5.1. so far the best I have found is GDFileManagerKit. but it still has stuff unsupported by my ARC such as AFNetworking version used. I do not want to alt the code of this library since it requires many changes. I would like to know if there is a better library or without me having to use AFNetworking version 1.
Thank you and please bear with me if this question is very novice. I am new to objective c xcode and iOS
You could use one of several free libraries, for example WTClient. Yet, every library I have seen is not using ARC, instead managing memory without the garbage collector.
I have a project from 2 years ago that I'd like to bring back into action in xcode.
Is there a simple way to do away with the old style memory management I have in there with retain/releases and use the new .. ARM?
And this is a 32bit app using the QTKit and QuickTime frameworks - can this become a 64bit app that I can put on the App Store one day if it works well?
Also I realise that my app is one enormous .h and .m file - i'd like to break it into smaller files to make it easier to read and find what i am doing - any tips on how to do that?
Thanks guys!
Adam
Use the Xcode menu item Edit->Refactor->Convert To Objective-C ARC which can automatically convert everything to ARC.
You can also use Edit->Refactor->Convert to Modern Objective-C syntax to update the code to use the new array/dictionary/number literal syntax.
For breaking out one file into many, Xcode's built-in refacting support is pretty terrible. You can try out Jetbrains Appcode which has much better support for this kind of thing.
I'm currently developing an iPhone/Android application in Phonegap and would like to record audio while playing back another track.
Now I know in Objective-C you can set the audio category to "AVAudioSessionCategoryPlayAndRecord" but since this is Phonegap and not a plain native objective-c app I'm not sure if it's possible for it to work or even where to put it as I think it needs to be in the phonegap core files somewhere>
Does anyone have any experience and/or ideas?
In case anyone else wants to know the answer to this, I managed to sort this issue out by recompiling Cordova/Phonegap (1.7.0 but 2.0 should be similar) with a tweak.
To tweak it I modified CDVSound.m, changing line 482 to
[self.avSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
And re-compiled and then used in my project.
This can be resolved by using a custom Objective C plugin, that sets the category of the AVAudioSession singleton instance to AVAudioSessionCategoryPlayAndRecord.
However there is a bug in the Cordova Media Plugin which complicates things, which can be worked around, if it is acceptable for you to start recording first, and then start playing the media.
If not, I have resolved this issue, and posted an answer here, where you can find more details:
Record and play simultaneously on iOS (Phonegap build)
I have an app that uses the ABAddressBook API and I am trying to convert my app to use ARC.
I know the AddressBook API is written in native C and its giving me a lot of errors when ARC is enabled.
Anybody knows how to do it or is it even worth to do it?
Thanks in Advance.
One possible solution is to set compiler flags for the code that is giving you trouble to convert to. Go to Build Settings for the particular target you are using and add the flag "-fno-objc-arc" to the files that are problematic. Also, any more info on the actual problems arising would be helpful.
bartender,
First, working code is working code. You can easily intermix both kinds of memory management mechanisms in the same app. I only convert classes to ARC as I open the code up for other purposes. This allows me to slowly move my app to ARC. Why do you want to change this code to use ARC?
Second, the interface between core foundation items and ARC can appear to be complex ... but it isn't. Most issues are handled by using the __bridge type qualifier. Typically, the compiler/fix-it tells you exactly what you need to do. (Working, non-leaking CF code doesn't need to change. It just needs to tell ARC to leave it alone.)
Andrew
When you read the Class Reference of every object of iOS, you will find:
Available in iOS 2.0 and later.
There are a program or a way to list all function and the minimum iOS system?
How can I know if the iPhone with iOS 3.0 will run all iOS function? I can check it in runtime with respondToSelector, but can be more easy with source code?
Set your project's base SDK to iOS 3, and see if it builds.
AFAIK there is no way to list all the APIs you use in your app into one list and check that you are building past the minimum for all those APIs. You will just have to check each one, one by one. Highlight the API in Xcode, and then click escape and it will tell you very easily.
But also I have to mention that this won't be extremely necessary since you should test on the minimum OS you are building for and if it crashes at any point then you have your issue for that certain API.