I'm having troubles creating a property of an array of integers in Objective C.
I'm not sure whether this is even possible to do in Obj-C so I'm hoping someone can help me in finding out either how to do it correctly or provide an alternative solution.
myclass.h
@interface myClass : NSObject {
@private int doubleDigits[10];
}
@proper...
I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shift+D and I'd like t...
How can I draw a string centred within a rect?
I've started off with: (an extract from the drawRect method of my custom view)
NSString* theString = ...
[theString drawInRect:theRect withAttributes:0];
[theString release];
Now I'm assuming I need to set up some attributes. I've had a look through Apple's Cocoa documentation, but it's ...
I've been working through the Stanford iPhone Coding course and currently hooking into the Twitter API. What I'd like to do is accurately handle two error conditions: One for when the username is invalid, and another for when the device is not currently connected to the internet. Unfortunately, as it stands, the best I can surmise is whe...
Hey everyone.
I am in the process of writing a menubar icon for an app i'm developing. However the NSStatusBar class does not have a method which would make the icon draggable, via cmd+left mouse drag.
How do you make your menubar icon draggable with Objective-C code?
Thank you :)
...
I'm triying to combine a TabBar + Navigation app.
I have 5 tab bars, 4 are listing of stuff and drill down to details views.
I try to follow this tutorial:
http://www.iphonedevforums.com/forum/iphone-sdk-development/124-view-controller-problem.html
But always get a blank view.
This is what I do, with a clean project:
I start with ...
HI,
I am developing a iphone app by using cocos2d. Its shown this msg.
2009-01-26 16:17:40.603 Find The Nuts[449:20b] *** -[NSCFArray onTimer:]: unrecognized selector sent to instance 0x59be030
2009-01-26 16:17:40.605 Find The Nuts[449:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFA...
In c# I can use the following code to have code which only executes during debug build, how can I do the same in xcode?
if #DEBUG
{
// etc etc
}
...
I'm developing a app with a list of products. I wanna let the user have 1 picture for each products.
Now, the problem is what to do next. I think that the best way is that the photos get sync when the user connect to their computer & itunes, and acces them from the app (something like: /photos/catalog/ref1.jpg.
The other option is put ...
I'm looking for the correct way to write my own interface objects.
Say, I want an image that can be double-tapped.
@interface DoubleTapButtonView : UIView {
UILabel *text;
UIImage *button;
UIImage *button_selected;
BOOL selected;
}
// detect tapCount == 2
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
This work...
Refering to a previously asked question, I would like to know how to get the title of the current active document.
I tried the script mention in the answers to the question above. This works, but only gives me the name of the application. For example, I am writing this question: When I fire up the script it gives me the name of the appl...
I wonder how is possible to make a view scroll, like in a table view.
I have a form that have several fields on it. I don't wanna buil it as a traditional table that drill-down.
Is not very large but because the main windows is a tab-bar I lack of a bit of vertical space. Also, when I try to fill a textfield get covered by the keywoard...
Can I simply use
if(myString == nil)
For some reason a string that I know is null, is failing this statement.
...
Okay this is a fairly broad question. This is my first App and I'm not sure the best way to go about this. The app is on the IPHONE.
I have a 'Restaurant' class. The restaurant has many different attributes and opening times.
I currently store a restaurant in an instance of nsdata (it complies to NSCoding) LOcal storage is easy and I j...
I am trying to use QuartzCore Framework but when adding this framework to my iPhone application, I am told that the files (e.g. CIColor.h and others) are missing but those missing files exist on my hard drive under /system/library/
In addition to the QuartzCore Frame work, I am using the following frameworks: cocos2d, cocoa.framework, o...
hello,
I am trying to develop a iphone app by using cocos2d. I create a alert view with a text field. when I touch the text field then comes the keyboard. But I want that when the alert is open, in the same time textfield will be selected and keyboard comes(without any touch). how can it posible ? sorry for my bad English.
...
I'm getting used to OCMock. Coming from a Java/JMock background I'm now looking for the ability to say [[[myMock stub] returnValueFromCustomMethod] someMockedMethod]; where returnValueFromCustomMethod is defined in the test class. I was originally thinking something along the terms of [[[myMock stub] usingSelector:@selector(myMethod:)] s...
Why is the following code (in cocoa) not working?
NSString *extension = [fileName pathExtension];
NSString *wantedExtension = @"mp3";
if(extension == wantedExtension){
//work
}
in Xcode this just runs without warnings or errors but doesn't do what I think it SHOULD do.
...
I wanna do something like the safari app when fill a form, so when the user see the keyboard do next and move to next control.
Now, how I get the next text control?
...
I have 6 UITextFields on my UIScrollView. Now, I can scroll by user request. But when the keyboard appear, some textfields are hidden.
That is not user-friendly. How scroll programatically the view so I get sure the keyboard not hide the textfield?
...