I use the following code to display a UISearchBar with a Scope Bar.
UISearchBar *searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 320, 45)];
searchBar.barStyle = UIBarStyleDefault;
searchBar.showsCancelButton = NO;
searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
searchBar.autocapitalizationType = UITextAutocapit...
I'm stuck with the following bit of code.
NSString *gridRef = [[NSString alloc] initWithFormat: @"%@", [converter LatLongToOSGrid: latLong]];
NSLog(@"Grid Ref: %@", gridRef);
self.answerLabel.text = [[NSString alloc] initWithFormat: @"%@", gridRef];
When I log gridRef, it displays the correct result. However, the line setting answerLa...
I get an annoyingly vague error from the following code:
GFree2AppDelegate *delegate = [[UIApplication sharedApplication] delegate];
context = [delegate managedObjectContext];
context is defined as a NSManagedObjectContext in the .h file and is the same in the delegate. All the right files seem to be included (except for <CoreData/Cor...
As the title says. Using the iPhone SDK, I want to RSA encrypt some (small) plaintext using an existing key and exponent I am given from a server for authentication. Surely this is a trivial task that requires one library import and a couple of lines of code? If not, why not?
...
Hello,
Beginner question here. In the .h file of an objective c class..
If you have an @property int someVar; for example.. and you're actually going to write the setter method yourself in the .m file.. do you still have to declare that setter method in the .h file?
If you have some @property declarations in the .h file and you are w...
Hi.
I want to display some data on table, let's call it "TabeView" app.
So I created a "navigation-based" application on XCode and it gives me 4 files in the "classes folder".
RootViewController.h
RootViewController.m
TableViewAppDelegate.h
TableViewAppDelegate.m
Now, I wanted to set up the data in TableViewAppDelegate using the "d...
Hi,
I have a QTCaptureSession with one QTCaptureConnection using h.264 for compression.
I want to stream the video over UDP with very low latency, but I'm having trouble understanding the QTKit framework.
As far as I can see I have two choices for output:
1) Subclass QTCaptureOutput and send the data that would go to the file out on a...
I have a managedObject with an attribute that is a Boolean. I need to compare the value of this and then hide a button if required.
There's a couple of caveats, firstly the isBookmarkHidden boolean can be set and will override the property of the managedObject so the button is hidden regardless. If this boolean is NO it will then use th...
I am curious about conforming a class to UITextFieldDelegate, in the past I have always added it to enable access to methods defined within the protocol. However this last time I forgot to add it, only realising later that it was missing. My question is why does it work with or without, I thought it was needed to correctly access the pro...
i get this error "expected identifier before 'OBJC_STRING' token" on this line of code:
- (id)initWithNibName:(NSString *)@"Landscape.xib" bundle:(NSBundle *)mainBundle {
and im not sure why, can anyone help?
...
So i am trying to make a game that will load a specific XIB file according to the device's orientation at launch. my code looks like this:
- (id)initWithNibName:(NSString *)nibName owner:owner bundle:(NSBundle *)bundleName {
if (UIDeviceOrientation == UIDeviceOrientationLandscapeLeft || UIDeviceOrientation == UIDeviceOrientationLand...
Hi,
I try to find out why my app crashes (RSS Reader) if I send a wrong URL to NSXML Parser. I got an EXC_BAD_ACCESS. So after some Searching I found out that I have to use Zombies. So I added the following arguments to the environment:
CFZombieLevel = 3
NSMallocStaclLogging = YES
NSDeallocateZombies = NO
MallocStackLoggingNoCompact...
Hi all
Im making an app for the iphone using cocos2d and i am trying to figure out the best approach for removing items from a NSmutableArray and from the layer at the same time.
What i mean by this is that the objects within the array inherit from ccNode and contain a ccsprite which i have added as a child to the cclayer. The below cod...
I have an XIB file containing a subview (footerButtonsView) containing two buttons. I change the position of the subview like so:
if (footerView.frame.origin.y < 280.0) {
[footerButtonsView setFrame:CGRectMake(footerButtonsView.frame.origin.x, footerButtonsView.frame.origin.y+300.0-footerView.frame.origin.y, footerButtonsView.fr...
Hello,
I've got this wired problem, I cannot get the content from the file and initiate my NSMutableArray with it.
Here's my code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSLog(@"Does file exist?: %i", [[NSFileManager d...
My Cocoa application is a socket server which receives video frame from my iphone, and displays them on the screen as a video.
I am saving every image in an array after i receive them.
Is there a way to convert this array of images to a video file and let the user to save this file to disk?
Thanks
...
Hi all,
I'm not very 'up' on multi-threading, but I've been using detachNewThreadSelector in a couple of places to access data in a database. Unfortunately, on slower devices the first request may still be happening when I call the second... Which naturally causes a crash because both are calling the same method (which is obviously not ...
I am aware that you can track when the contents of a folder have been modified while your application is not open on OS X with FSEvents, but it is difficult checking the modification date of every file in the directory when the application launches. Is there a way to change FSEvents or is there another mechanism to tell what files have b...
Is it possible to use rand() or any other pseudo-random generator to pick out random numbers, but have it be more likely that it will pick certain numbers that the user feeds it? In other words, is there a way, with rand() or something else, to pick a pseudo random number, but be able to adjust the odds of getting certain outcomes, and h...
I am trying to write an nsdata to a file on my disk, I have the following code and it doesn't work, am i doing anything wrong?
Boolean result = [data writeToFile:@"/Users/aryaxt/Desktop/test2.avi" atomically:YES];
test2.avi doesn't exist, I am assuming that writeToFile would create it for me
...