I am trying to run the memory leak program in conjunction with my iphone device. The program says that there are leaks however it doesn't give me details.
GeneralBlock-32 No stack trace available.
How can I set up the leak program so it actually works with my iphone to give detailed information like it does in the simulator.
...
In Objective-C, I have a category for a class:
@interface UILabel(CustomInit)
- (id)initWithCoder:(NSCoder *)coder;
@end
What I'm doing is writing a custom init function that does some extra stuff, and what I'd like to do, is in this custom init function, call the UILabel's base initWithCoder. Is this possible? How so?
EDIT
Thanks...
Hi there,
I'm fairly new to Objective C and Core Data and have a problem designing a case where players team up one-on-one and have multiple matches that end up with a specific result.
With MySQL, I would have a Player table (player primary key, name) and a match table (player A foreign key, player B foreign key, result).
Now how do I...
My PackageMaker project was generating a .mpkg file, but then, all of the sudden, when I go to build, it only generates .pkg files. The .mpkg files are actually directories into which I place my custom installer bundle along with an InstallerSections.plist file to specify the order in which my custom view should display. The .pkg files a...
Kinda new to iPhone programming and was experimenting with threads
- (void)viewDidLoad {
[super viewDidLoad];
[NSThread detachNewThreadSelector:@selector(changeMain) toTarget:self withObject:nil];
[NSThread detachNewThreadSelector:@selector(changeThread) toTarget:self withObject:nil];
}
- (void)changeMain{
NSAutoreleas...
I am planning on learning Objective-C to write an OS X application but it will depend on a library written in C++. Can C++ be used in an Objective-C app? Bear with me, I'm new to desktop development.
The C++ library will be used simply to analyze a file and return some data about that file. For example, in the libraries compiled example...
Hello,
I have a "didSelectRowAtIndexPath" action that adds a navigation bar and displays a new view. There's an action in the new view that pushes another view onto the navigation stack, and it works, but clicking "back" doesn't restore the previous view.
The sequence is basically:
user clicks table cell
Navigation bar appears, with...
Hi,
Here is the code I have:
Phone SDK undestanding cocoa object live cycle:
- (void) DismissWelcomeMessage: (UIAlertView *) view
{
[view dismissWithClickedButtonIndex:0 animated:YES];
}
- (void) ShowWelcomeMessage
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Blah" message:@"Blah Blah" delegate:self cancelButt...
When you take photos with the iPhone camera, they are automatically geo-tagged.
I have written the following code to take photos in my GPS Recorder app, but the photos are not being geo-tagged.
What am I doing wrong? Should I be using a completely different method, or is there some way I can modify my code to add the geo-tag and other...
I am trying to expose the pathForResource functionality to C++ from objective-c.
However, I am very new to objective-c and have not been able to discern how to use a c string as an argument in objective-c. clearly I have the wrong idea here.
how do i get pathForResource to use c strings as an argument?
here is my function:
static...
I am getting some weird numbers returned from the characterAtIndex method for Object-C in the iPhone SDK. The code snippet is as follows:
NSString *new_text;
new_text = [new_text stringByAppendingFormat:@"%@",UITextView_1.text];//=a,b,...f
for(int i = 0; i <= 6; i++)
{
char_num = [new_text characterAtIndex:i];
}
I am tr...
Hi Folks,
I've got an NSMutableArray that holds a bunch of objects, what I'm trying to figure out is how much memory is the array using. After looking at a couple of places I know about the sizeof call, and when I make it I get 32 bits (which is the size of the NSMutableArray object it self).
Example code:
NSMutableArray *temp = [[NSM...
In a Cocoa-Touch iPhone app, I get this error if I add a class named List to my Xcode project:
objc[25878]: Class List is implemented
in both /usr/lib/libobjc.A.dylib and
/Users/steve/Library/Application
Support/iPhone
Simulator/User/Applications/4883BE28-51DA-493C-9D8A-28FD026708F4/Duplicate Classes Test.app/Duplicate Classe...
I am currently trying to compile OCMock with GCC4.2 (original: 4.0) and start getting the following warning:
warning: passing argument 1 of
'partialMockForObject:' from distinct
Objective-C type
the calling method is:
- (void)forwardInvocationForRealObject:(NSInvocation *)anInvocation
{
// in here "self" is a reference to ...
If i try to use this simple code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
NSString *stringMer = [NSString stringWithFormat:@"OK COOL"] ;
NSString *stringMer2 = [NSString stringW...
The application will stop responding to any touch events after clicking on either button. (Controller#increase / Controller#decrease methods).
Here is the output of the console on startup
[Session started at 2009-10-04 14:41:20 +0300.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul 3 01:19:56 UTC 2009)
Copyright 2004 Free S...
I have two subclasses, one that has a lot of customization, we'll call it Foo, and another sub class that only needs 1 method overridden, and doesn't need any additional variables, we'll call it Bar.
Bar will be one of the variables of Foo, so to keep from having 2 more files to work with (.m and .h for Bar) I would like to interface an...
I have a subclass of a UILabel that overloads initWithCoder and I was wondering if anyone has any documentation on how the coder is encoded so that I might be able to get information that comes from IB myself.
Thanks.
EDIT
Reason for doing this: I would like the font name given in the xib file. Apple's implementation of initWithCoder ...
If I release an instance of NSOperation before sending -init to it I get a segmentation fault.
Reasons I think this is valid code:
Apple does this in its documentation.
Gnustep does it in its implementation of NSNumber, so it's fairly certain that this is in Apple's code too. (At least was.)
NSObjects -init doesn't do anything, theref...
A simplified example here:
I have a game that I am writing in opengl es. The game has two different screens that do completely different things based on the user's touch input.
What is the best way to abstract out the uitouch events from the view?
I imagine that in a perfect world the touch events would be handled by my game loop, bu...