I want to play an audio file which is posted on a website. I'm trying to use AVAudioPlayer and set the url to its website link. But the bgPlayer turns out to be nil. I think I can download this audio file and play it afterwards, but is there any way to play it while I'm downloading it?
NSURL *bgURL = [NSURL URLWithString:@"http://www.ra...
I know the task returns a value to standard error, which I can see by entering "echo $?" in the terminal after running the task manually.
Now this code:
[aTask launch];
[aTask waitUntilExit];
int status = [aTask terminationStatus];
looks ok, but gdb says status is a location at 0x0 and cannot be accessed. Does anybody know of any bu...
Hi everybody !
Can someone help me ? I have a NSString with @"12.34" and I want to convert it into a NSString with the same float number but in single precision 32bits binary floating-point format IEEE-754 : like @"\x41\x45\x70\xa4" (with hexa characters) or @"AEp¤"...
I'm sure it's something easy but after many hours of reading the doc...
Hi there.
I am trying to save the dimensions of my document window through Core Data. I have used the following code to save the width and height:
managedObjectContext = [[[NSDocumentController sharedDocumentController] currentDocument] managedObjectContext];
NSSize windowSize;
windowSize.width = documentWindow.frame.size.width;
windo...
Hello guys!
In the interface builder, I can set the alignment for my UIToolbar to be at the bottom of my screen or to be at my top of my screen. How can this be done programatically?
...
I am using the UIImagePicker to access the camera on my iPhone app. I would like to be able to have two different overlays for the imagepicker, depending on the orientation of the iPhone. Is it possible to do this? It seems like if I place the following method in the class that owns the UIImagePickerController, it does not get called at ...
I'm making an Xcode framework, and I have one public header which accesses a bunch of project headers. But when I import the framework in another project, it throws errors that it can't find the header files that are project. I have referenced objects from the project headers in the public header. How do I keep those headers project but ...
Does anyone know how (if possible) I can find out how much capacity (mAh) is remaining in an iPhone battery at any given time?
Something like the program above?
Is there a value stored in a plist somewhere??
...
I'm attempting conversion of a legacy C++ program to objective-C. The program needs an array of the 256 possible ASCII characters (8-bits per character). I'm attempting to use the NSString method initWithBytes:length:encoding: to do so. Unfortunately, when coded as shown below, it crashes (although it compiles).
NSString* charass...
Hi All,
By using IPhone SDK (on a jail broken iPhone), how can I share a contact (.vcf file) through mail as same as the address book is doing?
Regards,
Prathap.
...
Are UITextFields not meant to be part of the LogicTests and instead part of the ApplicationTest target?
I have a factory class that is responsible for creating and returning an (iPhone) UITextField and I'm trying to unit test it. It is part of my Logic Test target and when I try to build and run the tests, I get a build error about:
...
I've looked through the SDK documentation and through other questions that have been asked, and I am still a little confused on how exactly to do this. I had been previously been working with the following code, though it does not give the desired result of a .plist file. Besides mentioning the IBAction in the header files in this code...
I have an enum named RandomEnum in file foo.h:
// foo.h
typedef enum RandomEnum {
ran_1 = 0,
ran_2
} RandomEnum;
In another file, bar.h, I'm trying to use RandomEnum as a parameter type:
// bar.h
#import "foo.h"
@interface bar : NSObject {}
-(RandomEnum)echo:(RandomEnum)ran;
@end
However, the compiler doesn't seem to recogni...
I'm using a UITextView to roughly replicate the SMS text box above the keyboard. I'm using a UITextView instead of a field so that it can expand with multiple lines.
The problem is that, in my UITextView, the correction suggestions pop up below the text, causing them to be partially obscured by the keyboard.
In the SMS app, the sugges...
I've reading in several post and in Apple's code guidelines that in Objective-C String constants should be defined as extern NSString *const MY_CONSTANT; and that the #define directive should be avoided. Why is that? I know that #define is run at precompile time but all string will share the same memory address. The only advantage I read...
Hey everybody,
I'm curious - is it possible to programmatically change the name of an iPhone app that is used on the iPhone OS home screen? I know it's just an entry in the Info.plist file, but I haven't seen any apps doing it.
I'd like to distribute a "Lite" version of an existing app and allow users to upgrade to the full version via...
There appears to be at least three different libraries for extracting JSON data from an HTTP request.
TouchJSON (http://code.google.com/p/touchcode/)
BSJSONAdditions (listed at json.org - http://blakeseely.com/blog/archives/2006/03/29/bsjsonadditions-12/
json-framework (http://code.google.com/p/json-framework/)
Any reason I would sel...
I am using an NSView to host several Core Animation CALayer objects. What I want to be able to do is grab a snapshot of the view's current state as a bitmap image.
This is relatively simple with a normal NSView using something like this:
void ClearBitmapImageRep(NSBitmapImageRep* bitmap) {
unsigned char* bitmapData = [bitmap bitmap...
I'm beginner in Iphone!
Can I place many UITableView (greater 1) in a View? And how to control them?
...
I have two UIImageView's, and I want to concatenate them both to be one UIImageView. To let you know, the images have some transparency to them so you will see both of them. Als they are the same size.
...