If I create a custom initWith for an object do I essentially include the code I would add should I want to override init?
-(id) init {
self = [super init];
if (self) {
NSLog(@"_init: %@", self);
}
return(self);
}
e.g.
-(id) initWithX:(int) inPosX andY:(int) inPosY {
self = [super init];
if(self) {
...
Hi,
How do you get a datetime column in sqlite objective-c ?
I have a table with 4 fields: pk, datetime, value1 and value 2. pk (primary key), value1 and value2 are integer so I am using:
int value1 = sqlite3_column_int(statement, 2);
int value1 = sqlite3_column_int(statement, 3);
But what should I used for datetime?
Thx
...
This is really odd...
I run my app, and while it is opening and the views are constructing I get:
Collection <CALayerArray: 0x124650> was mutated while being enumerated.
The code trace goes through the following:
main
UIApplicationMain
-[UIApplication _run]
CFRunLoopRunInMode
CFRunLoopRunSpecific
_UIApplicationHandleEvent
-[UIApplic...
For the life of me, I am being continually stumped with NSComboBox.
I created an object that conforms the NSComboBoxDataSource protocol, and implemented:
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox;
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index;
I set the instance of my NSComboBox...
I want to create a constant static array to be used throughout my Objective-C implementation file similar to something like this at the top level of my ".m" file:
static const int NUM_TYPES = 4;
static int types[NUM_TYPES] = {
1,
2,
3,
4 };
I plan on using NUM_TYPES later on in the file so I wanted to put it in a variable.
...
I send some data from my App to a web service and it replies. I start that process by clicking a button in the UI. It works fine, until I start trying to do that really fast. If I do that fast it breaks and I get this message:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[_NSXMLParserInfo leng...
I was looking at this SO question and got to thinking about const ints versus #defines and realized I don't actually understand why the compiler can't deal with this. Could someone shed some light as to why the following code
const int FOO = 10;
int main(int argc, char** argv)
{
switch(argc)
{
case FOO: { printf("foo\n"...
Hi,
I'm using the Utility Application template to build my app.
Having a hard time getting an image to show up as the app launch. (I'm having this difficulty with all the templates basically)
Basically, right now when the app launch, it starts with a black background and it takes a second or 2 before the content appears.
However, I see...
I am using a UIButton in my application. This button title is displayed dynamically as per the user choice. Now i have to resize the button width as per the title content.
I am calculating the string length and assigning it to button's width.
the button is resized as per title but the problem is as follows,
1. If at first the title with...
When I generate my classes from CoreData entities I get generated methods
@interface Site (CoreDataGeneratedAccessors)
- (void)addSearchesObject:(Search *)value;
- (void)removeSearchesObject:(Search *)value;
- (void)addSearches:(NSSet *)value;
- (void)removeSearches:(NSSet *)value;
@end
So my question is pretty simple when I call rem...
I'd like (at runtime) to bind a parameter to a function as you can do in boost::bind - a little like the following:
-(void)myFuncWithParameter:(NSString*)param {
NSLog(param);
}
-(void)init {
UIButton *helloButton = [UIButton buttonWithType:UIButtonTypeCustom];
[helloButton addTarget:self action:@selector(myFuncWithParameter:...
I'm reading pixels from an area of the main screen via NSOpenGLContext. Now I would like to draw a rect around that area to indicate where it actually is.
How would I do this?
My first thought was the "Cocoa way": create a transparent fullscreen NSWindow and a custom NSView to draw the rectangle path. But that feels a bit too complicated...
I have created settings bundle and also three switches for alert,sound and badge.i am also getting 0 or 1 according to switch(On/Off).Now how do i enable only selected notification types when calling this method
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(here i want to set types from settings)];
how do i ...
Hi there, im trying to programatically do a UITabBarController using a UINavigationController inside each UIViewController called by the tabs... tried everything... read every article... but 100% of the tutorials ive found uses in the UITableViewControllers... here is the app delegate:
//
// mluThunderCamAppDelegate.m
// mluThunderCam...
I'm trying to change the sorting in a NSFetchController on the fly, by some sort of segmented control. To either sort A->Z Z->A type thing.
What do I have to do to do this? I'm following Jeff Lamarche's example here: Here
Do I need to make a new NSFetchedResultsController and then set it, or do I just make a new NSFetchRequest and do
...
This is probably a silly question but I have been thinking it over for a while with no obvious answer.
I have a small app that I have been working on and am having a problem with my NSMutableArray instance variable. It was always (null) until I added an [[NSMutableArray alloc]init] to the viewDidLoad.
I am pretty new to the Objective ...
Hi,
I've a string that may or may not include C++ comments on it (multi-lin and single line) and I need to strip those comments out before being able to use that string. My current idea is to use an NSScanner to do that - find the position of opening and closing multi-line comments and delete that portion of the string and find the posi...
hi,
i'm getting this error as i read RSS beginning with xml version="1.0" encoding="US-ASCII"?
if i change like that xml version="1.0" encoding="UTF-8" , no problem to read the same RSS.
Do i have to ?
1/ download from a server to a file
2/ read the encoding and replace it by UTF8
3/ parse the file...
or can i do something else BEFORE...
Hey guys,
I've been searching the web for a really long time, and I can't get this to work. On my text field I have, when I click on it and then press done or return it won't go away. I've done all the steps for every single tutorial but I still can't get it to work. I'm on firmware 3.1.2, but anyway here is the code in my ViewControlle...
Hey all,
So, in my iPhone app I was using integers to keep track of a lot of variables. I declared and initialized them all in my AppDelegate file (it's a multiview app), and then if I declared them in the other views (classes) and the values would stay the same. In this way, I could set Money = 200 in the App Delegate file, and then ...