There is probably a very simple solution for this but I can't get it working.
I have got multiple classes in my Cocoa file. In one of the classes class1 I create a variable that I need to use in another class class2 as well. Is there a simple way to import this variable in class2?
...
Hi all,
I'm curious, how do most of you folks handle errors such as HTTP Forbidden or 5xx type requests from a server? Or say an exception is thrown in one of your UIViewControllers? Do you typically bubble up the error to the App Delegate and handle generic "window" level errors at that point? Do you couple errors directly into the UIV...
Wondering if there is an easy way to do a simple HTML escape/unescape in Objective C. What I want is something like this psuedo code:
NSString *string = @"<span>Foo</span>";
[string stringByUnescapingHTML];
Which returns
<span>Foo</span>
Hopefully unescaping all other HTML entities as well and even ASCII codes like Ӓ a...
In php I have:
$result = mysql_query($query);
// if successful query, return the records
if ($result)
{
// if not empty result, return array of records
if (mysql_num_rows($result))
{
$records = array();
while ($row = mysql_fetch_assoc($result))
{
$records[] = $row;
}
return $records;
}
}
In Objective-C - After th...
Hi, I want to develop an iphone interface, using objective-c, which behaves like an Excel sheet.
It would display a grid which can be scrolled vertically as well as horizontally but during a vertical scroll, the first row will freeze, and during a horizontal scroll, the first column will freeze.
How can this be done?
I am new to iphone...
If I declare class variables in Objective-C, when is the memory released?
If my interface is:
@interface TestClass : NSObject
{
}
+ (NSString)instanceCount;
@end
And in the implementation, I declare:
static NSString instanceCount;
How do I release this class level variable? i.e. when is the dealloc called for class variables in ...
In reference to my previous question, I would like to know how to implement a large grid of cells in an iPhone application.
I'm working on an interface which would be similar to an Excel spreadsheet, with many rows and columns. Do I have to handle each cell separately? How can I handle user interaction in each cell?
Is there a standard...
I've created a "Settings" model for my iPhone app. It only contains two properties and a class method for loading and one instancemethod for saving.
I load it as follows
+ (UserSettings *)getCurrent {
NSUserDefaults *userPrefs = [NSUserDefaults standardUserDefaults];
UserSettings *settings = [UserSettings new];
settings.use...
I write a piece of code to "do something->show alert1->do something->show alert2".
//do something
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Alert 1"
message:nil
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert re...
Hi all..
I have made an app with a Tabbar and an RSS reader in one window.
I know how to open the RSS links in the build in safari browser, but how do I open the links in a UIWebView in the same tab instead? I don't want to quit my app to view the webpage, and how do I go back to the RSS view? Simply by hiding the webview?
Hope you ca...
I'm trying to use libtidy for an iPhone app (since the iPhone 2.2 SDK doesn't include NSXMLDocument which has tidy functionality) but I get a linker error saying "library not found for -ltidy" when I build the app.
As for other framework/library references, I've added the libtidy.dylib to my list of referenced frameworks and I've added ...
Hi,
I have a question - how can I get a number of row selected in a table? I am assigning it manually to a variable. The problem is that if a row was deselected, my variable still keeps the old value.
What can I do about it? Is there a method in UITableView that returns a number of a currently selected row?
Thank you in advance,
Ilya....
I have an Action Sheet popping up and I want to pass a certain argument to a button processing method.
For example:
I have a table and I want to pass to a button processing method row number that was selected in a table.
How can I achieve this?
...
I'm new to XCode 3.1.2 and Objective-C 2.0. I've just discovered using breakpoints for logging instead of littering the code with millions of NSLog() statements. The problem is, when the debugger starts up it spews half a screen full of status and credits info into the console.
Is there any way to suppress this text?
...
I see a lot of code such as the following as of late:
id<foo> aBar;
Typically this is something I'd see in a class declaration, such as:
@interface bar : UIViewController <UITableViewDelegate, UITableViewDataSource>
Does the above mean that aBar might be an instance of class bar and promises to have all of the methods declared in t...
I'm trying to convert a string of numbers, entered by the user, into a sexy string like Phone.app on the iPhone. Here is the code I'm using, which doesn't work (no special format comes out) and after a certain number of digits it just starts adding "0" to the end of the string.
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] i...
I am using CGImageCreateWithImageInRect() for generating a small image from a background image runtime, which is going to displayed for every thread call (0.01 sec). Once I start showing part of image through CGImageCreateWithImageInRect application starts consuming memory in very high rate and crashes within seconds. Memory consumed goe...
I am trying to develop a simple iPhone app. I need to play sound within a loop.
How can Play Audio file in loop without any interruption ?
...
hi to all,
can anyone help me to do making phone call by using objective c.
thanks in advance...
...
After four weeks of learning Objective-C for the iPhone, my first useful application is almost finished. However, I still need to save several instance variables whenever the current view is changed and to reload them when the view is reopened.
I have no trouble loading variables with basic C types like int and BOOL, but am having diffi...