In Objective-C, I can write:
id pString = @"Hello, World.";
and the compiler will instantiate an NSString without me needing to explicitly call a factory method. However, NSString is really just a Foundation class and thus presumably not part of the actual Objective-C language definition.
So when I write @"String", how does the comp...
The static analyzer is showing up a leak in this block of code (specifically the link with the copy in it):
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI
qualifiedName:(NSString *)qName
{
if ([elementName isEqualToString:@"item"])
{
[elements setObject...
I've noticed that when I load a UIImagePickerController and I take a picture with it, didReceiveMemoryWarning is called. Also, in Instruments, there is a significant memory leak (not by me, I swear!). I've heard that this is a problem with UIImagePickerController but, I'm not sure how to fix it. Here is my implementation of UIImagePicker...
I'm trying to get a string displayed in my UITextView the moment the app is launched. I have a UIView and (obviously) a UITextView in my interface, and one outlet, myText, which is connected to the UITextView. It doesn't seem to be working and I can't say why....
Here is the code in question:
MainView.h
#import <UIKit/UIKit.h>
#impo...
I got this error when i press build+debug:
ld: duplicate symbol .objc_class_name_BlogTableItemCell in /Users/fabian/Development/Workspaces/iphone_experiments/xcode_build_output/MausLog.build/Debug-iphonesimulator/MausLog.build/Objects-normal/i386/BlogTableItemCell-3733583914888A7B.o and /Users/fabian/Development/Workspaces/iphone_exp...
I want to add the content of the cell of tableview in other view when i click on the tableview cell , how can i pass the values of the cell to other view.
...
When i'm trying to call protocolA methods, on an object of protocolB, i'm getting compiler warnings", but how would i restrict it to only methods of protocolB, i mean it shouldn't allow me to run the code, it has to give me an error ??? Is there any method to solve this problem in Objective-C?
Example :
// this is protocolA.h
@protoco...
I wrote code that looked like the following:
template<typename CocoaWidget>
class Widget : boost::noncopyable
{
private:
CocoaWidget* mCocoaWidget;
public:
Widget()
{
mCocoaWidget = [[CocoaWidget alloc] init];
}
// ...
};
class Button : Widget<NSButton>
{
// ...
};
But that doesn't work, because Mac Dev Center says:...
Hi,
I need to call a method through the object created by the interface ie
id<MyProtocol>obj;
Now i have created this obj in my main class where i am not implementing the methods of this protocol but i need to access the method which is already implemented in someother class.I am now calling the method as follows
[obj load];
in ...
I am new to iphone development i have created one view controller and i used grouped table view. Now i want to display the header view in my viewcontroller with image and labels. please guide me and help me out in this problem.
Thanks.
...
Hi,
im searching for a solution of the following problem:
i got a "larger" XHTML string that i want to display in an area that is scrollable.
I already used TTStyledTextLabel for a small text-caption and it works pretty well.
But now i want display it more like a UITextView that scrolls or a UIScrollView with my TTStyled Content in it...
Hi,
i was wondering how to make a ViewController (or TTViewController) scrollable, e.g. for long pages?
My first try (make the frame bigger) doesnt work.
CGRect appFrame = [UIScreen mainScreen].applicationFrame;
CGRect frame = CGRectMake(0, 0, appFrame.size.width, appFrame.size.height + 200);
self.view = [[[UIView alloc] initWithFrame...
Guys, I have two classes AppController and Robot.
AppController.h
#import <Cocoa/Cocoa.h>
#import "Robot.h"
@interface AppController : NSObject {
Robot *myRobot;
}
- (IBAction)initPort:(id)sender;
AppController.m
#import "AppController.h"
@implementation AppController
- (IBAction)initPort:(id)sender
{
[myRobot nothingDo];
}
@e...
Hi guys
Im wondering what is the simplest way to get the current price of a stock from say yahoo finance (or similar) in objective-C For the iPhone SDK.
Simple is the key, I am looking for current price, and days movement.
I havent had much luck finding an iPhone code example or library.
regards
...
In UILabel there's functionality to truncate labels using different truncation techniques (UILineBreakMode). In NSString UIKit Additions there is a similar functionality for drawing strings.
However, I found no way to access the actual truncated string. Is there any other way to get a truncated string based on the (graphical) width for ...
I have my app set up to send a custom level in a form of a array to another person during a p2p connection. The receiving device saves the array to file for later use. I set up gamekit in my application, it will successfully search and connect to another device without any problems. Though a problem arises when I send data to a device, t...
I'm using a NSKeyedArchiver to encode a big object graph (76295 objects.)
It takes a lot of time but even worse the NSKeyedArchiver doesn't give back all its memory.
After using the Leak check, the code doesn't appear to leak at all but for some reason the encoding doesn't give back all memory after it's done.
Calling the encode method...
I am new to iphone development .I want parse an image url from a xml file and display it in a RSS feed.There are three image url but i want to retrieve only one url and display it.
<entry>
<id>xxxxx</id>
<title>xxx xxxx xxxx</title>
<content>xxxxxxxxxxx</content>
<media:group>
<media:thumbnail url="http://tiger.jpg"/>
<media:thumbnai...
I have something similar to this.
initMyclass {
if (self= [super init]) {
classMember = [[NSMutableArray alloc] init];
}
return self;
}
Instruments reports a leak there.
I'm leaking memory there ?
If not, xcode reports false memory leaks ?
Thanks.
...
Objective c | xcode | iphone question
Im building a model(data) class for a monetary transaction and have kind of a basic/noob question regarding pointers and object copying. The Transaction class I'm creating contains 4 or 5 ivars/properties that represent object type variables. now when I get the user entered data from the view contro...