With ios 4.x it is under SpringBoard, but in ios5 I can't find it.
Where is SBSMSManager in ios5 or which class in ios5 has same functions with SBSMSManager in ios4.x?
Thanks.
It seems that no SBSMSManager, but I get a simulator class called SMSPluginManager. Get the binary file named ChatKit in your iPhone.The file is under the path "/System/Library/SpringBoardPlugins/ChatKit.servicebundle/" and then class-dump it.
By the way, SpringBoard will load some plugins that are under the /System/Library/SpringBoardPlugins when it starts. When you can't find a class, try there.
Related
I want to know if it's possible to play Ogg Vorbis audio file with iPhone SDK or if exist a library or a framework that allow this.
I've read something about OpenAL but I don't find any tutorial...
Can anyone help me??
Better late than never ;)
I have found the answer here Use cocos2d for playing ogg file in my project?.
PASoundMgr is a different sound engine that had support for ogg file
playback. However, it hasn't been updated since iOS 2.x and there are
numerous issues that have cropped up since then that it doesn't
handle.
Why do you need to play ogg files? If you convert them to aac you will
be able to play them back using hardware decoding which is much more
efficient from a cpu usage point of view.
They mentioned PASoundMgr. It worked for me. I just copied from cocos2d framework all files->libraries that SoundEngineTest was based on. And got rid of unnecessary code.
Here is my demoProject that shows how to play ogg on ios.
Be careful with iOS 5.* simulators, they have some problems with sound library. My demo works on 4.3 simulator and on Device.
Here are steps that I made to create demo:
First you will need cocos2d-iphone framework. I've already had it, but you can find it here cocos-2d_download.
As you can notice SoundEngineTest depends on libvorbis.a. It's a library that made of files from external/Tremor group. Also it depends on OpenAl, AudioToolbox frameworks.
I copied all files from tremor group to my project. Crearted "vorbis" Cocoa Touch Static Library, without ARC. And added all source files and header to the "vorbis" target in Build Phases tab.
In the Build Phases of OggPlayDemo Added libraries (libvorbis, OpenAl, AudioToolbox) to the Link Binary with Libraries box.
Added PA classes to project. And checked OggPlayDemo as a target. To avoid problems with ARC, I disabled ARC compilation for this 3 PA files. (see disable ARC for single file)
Removed all cocos2d references. There were some code related to correcting position of listener depending on orientation... I commented it. I don't need this feature for just playing audio.
Copied audio file.
And finally added this code to ViewController:
- (void)viewDidLoad
{
[super viewDidLoad];
//init
[PASoundMgr sharedSoundManager];
[[[PASoundMgr sharedSoundManager] listener] setPosition:CGPointMake(0, 0)];
self.audioSource = [[PASoundMgr sharedSoundManager] addSound:#"trance-loop" withExtension:#"ogg" position:CGPointMake(0, 0) looped:YES];
// lower music track volume and play it
[self.audioSource setGain:0.5f];
}
- (IBAction)play:(id)sender {
[self.audioSource playAtListenerPosition];
}
Cricket Audio will play ogg files, among others, and works on iOS/Android/WP8.
I made iPhone app with eventkit framework. However, i upgrade to universal app, app can't run in ipad. I got error message
dyld: Library not loaded: /System/Library/Frameworks/EventKit.framework/EventKit
Yes, event kit only work for iOS 4.0 or later. So, how to make it for universal.
I want to make , if iPad app, don't use event kit framework.
However, I can't add
#import <EventKit/EventKit.h>
#import <EventKitUI/EventKitUI.h>
in run time
You need to do two things:
First, weak link against the EventKit framework. You do this in Target->Get Info->General.
Secondly, you need to decide at run time whether or not certain functionality is available:
Class someClass = NSClassFromString(#"SomeClass");
if(someClass) {
// iOS4 code
}
else {
// iOS3.2 code
}
Need to make weak linking.
Right Click on Target -> Get Info -> General Tab
change Eventkit Framework required to weak.
I know this is a really weak answer, but the only answer if you need EventKit on the iPad: Wait until next month when iOS 4.2 ships for the iPad. At this time use the 4.2 beta to develop your universal app. Maybe your app can be ready when the App Store starts accepting apps requiring iOS 4.2.
I am trying to extract an image frame from a video taken from iPhone camera using ffmpeg. But it usually throws me a EXEC_BAD_ACCESS and the stacktrace is showing in another method calls that is never called (I know my code didn't call it)
I am using the ffmpeg built from the instruction of the iFrameExtractor website. If anybody do it successfully, please help me or if possible, send me some codes. I don't know why it crashes, although it works well on the simulator (which I manually import a video into the library). My guess is that ffmpeg cannot decode the iPhone video camera correctly.
I already tried to use all 3 sets of library files like arvm6, arvm7 and i386 but doesn't work. My iPhone is 3gs. My iphone sdk is 3.1.3
I think it is my fault in calling the VideoFrameExtractor. The example code doesn't work well. I have to change from videoExtractor.currentImage to [videoExtractor currentImage]
Why would you use ffmpeg? You can extract frames using the AVFoundation framework in iOS4. It's faster and easier to use.
Can you paste in your stack trace and possibly the code you are using to read the frames?
I'm working on a new app that I want to be universal for the iPhone and iPad. I started out with the "Create a Window-based app" wizard, and it created separate app delegates in "iPhone" and "iPad" groups. Since I already was quite familiar with iPhone dev, I did that part of my project, and now I'm ready to do some iPad stuff.
So... I started out by adding a UISplitViewController to my iPad delegate, switch the Active SDK to 3.2, and it works! But when I switch back to 3.1.3, and try to run it in the simulator, Build and Go fails. For starters, I see:
...path.../iPad/AppDelegate_Pad.h:13: error: expected specifier-qualifier-list before 'UISplitViewController'
I've got my Base SDK set to 3.2 and my Deployment Target set to 3.1.3. I thought that was enough. But I also have found in the documentation this method to conditionally compile:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
MyIPadViewController* vc;
// Create the iPad view controller
#else
MyIPhoneViewController* vc;
// Create the iPhone view controller
#endif
So do I need to do this everywhere? It seems like an awful lot of code to add (that I'll be getting rid of in a short time for 4.0 anyway) so I feel like I must be doing something wrong. And, I don't even have any idea how this works for things like #property or #synthesize declarations.
tl;dr version of the question - did I miss a setting somewhere?
I use this C function to help keep the code concise:
BOOL isPad() {
return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
}
Another thing I do, when I have different xib files for iPhone vs iPad. I have a stripPadSuffixOnPhone() function that helps keep the code simpler:
// Load/create the Delete table cell with delete button
self.deleteCell = [Utilities loadNib:stripPadSuffixOnPhone(#"DeleteCell~ipad")
ClassName:#"DeleteCell"
Owner:self];
Things like that can make coding more straightforward and a lot less conditionals. Still have to test everything twice though.
Quite the opposite. A universal app runs the same binary on iPhone and iPad so you cannot use conditional compilation to differentiate between the two version. But you need to use the macro Apple cites in the documentation:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// iPad-specific code
} else {
// iPhone-specific code
}
Here's what works for me:
Build your app using SDK 3.2.
Switch the active SDK to iPhone Simulator 3.1.3 (or whatever).
From the Run menu select Debug (not Build and Debug).
The binary built under 3.2 will be installed in the 3.x simulator without rebuilding. When you are finished don't forget to set your active SDK back to 3.2.
sound = [[NSSound alloc] initWithContentsOfFile:#"staticbeam09.wav" byReference:YES];
Code referenced from Apple docs. Getting an error when I put this in viewDidLoad. If I put
NSSound *sound;
in the header file, I get the specifier-qualifier error at the top of my implementation file. What do I have to do to make this work? I was just pasting the code from Apple's documentation - has this been deprecated? Thanks for your help!
There is no NSSound class in iPhone SDK
It's only for MacOS
Oxigen’s right. If you want to play sounds on iPhone, there are several options. Probably the easiest one is using Audio Services (example wrapper), then there is AVAudioPlayer and then you can also use OpenAL (I’ve written a very basic OpenAL sound effect engine called Finch). Depends on what you need to do.
http://icodeblog.com/2009/05/04/iphone-game-programming-tutorial-part-4-basic-game-audio/
that is how i did the audio bg music and sound effects at the end for iconquer