Search Results

Search found 964 results on 39 pages for 'simon sheehan'.

Page 10/39 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to convert a UTC date to NSDate?

    - by Sheehan Alam
    I have a string that is UTC and would like to convert it to an NSDate. static NSDateFormatter* _twitter_dateFormatter; [_twitter_dateFormatter setFormatterBehavior:NSDateFormatterBehaviorDefault]; [_twitter_dateFormatter setDateFormat:@"EEE MMM dd HH:mm:ss ZZZ yyyy"]; [_twitter_dateFormatter setLocale:_en_us_locale]; NSDate *d = [_twitter_dateFormatter dateFromString:sDate]; When I go through the debugger *d is nil even though sDate is "2010-03-24T02:35:57Z" Not exactly sure what I'm doing wrong.

    Read the article

  • UINavigationController does not set view properties correctly when pushed

    - by Sheehan Alam
    I have a UITabBarControllerDelegate that pushes a new view controller when a certain tab is pressed: - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { MyView* myView = [[[MyView alloc] initWithNibName:@"MyView" bundle:nil]autorelease]; if([self.tabBarController.selectedViewController.title isEqualToString:@"Friends"]){ NSLog(@"Clicked Friends"); myView.reloadFriends = TRUE; [self.navigationController myView animated:YES]; } } However, if I change my code to set the tabbar's selected view controller to myView everything works, but I don't get my navigation bar: if([self.tabBarController.selectedViewController.title isEqualToString:@"Friends"]){ NSLog(@"Clicked Friends"); myView.reloadFriends = TRUE; self.tabBarController.selectedViewController = myView; } How can I set the reloadFriends property in MyView and have the navigation bar at the top?

    Read the article

  • How to load View from NIB into another NIB?

    - by Sheehan Alam
    I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib contains a UIButton I want ChildViewController.xib to load in the ParentViewController.xib's UIView I have done the following: Created @property for UIView in ParentViewController Connected File's Owner to UIView in ParentViewController Set UIViewController in ParentViewController's NIB Name property to ChildViewController in Interface Builder Set ChildViewController view property to UIView in ParentViewController I was hoping this would load ChildViewController into my UIView in ParentViewController but no luck. I did get the following warning, which could be the culprit: 'View Controller (Child View)' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported. I also have added additional code in ParentViewController's viewDidLoad(): - (void)viewDidLoad { [super viewDidLoad]; ChildViewController *childViewController = [[ChildViewController alloc]initWithNibName:@"ChildViewController" bundle:nil]; childViewController.view = self.myView; } Any thoughts on why ChildViewController does not load in the UIView of ParentViewController?

    Read the article

  • UIButton doesn't appear on UIToolbar

    - by Sheehan Alam
    I have a UIToolbar where I have dragged a UIButton. When I set the button properties to Custom, and assign an image (or background image) the graphics don't appear. However, when I give it a custom text, the text will appear. Why is it that the images don't appear?

    Read the article

  • Problem dismissing multiple modal view controllers

    - by Sheehan Alam
    I am having trouble getting my modal view controllers to display properly. I have a parent view controller that is the delegate for modal view A. In modal view A I am presenting modal view B, and having the delegate dimiss modal view A. When modal view B appears it seems to display but the screen dims, and the UI locks up, but the app doesn't crash. I set animation settings to NO and I am still getting the same issue.

    Read the article

  • Converting NSMutableData to NSString Problem

    - by Sheehan Alam
    initWithData does not convert my data object into a string properly. When I check the length of the data object, it has a value. NSMutableData* receivedData =[[NSMutableData data] retain]; NSString* json_string = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding]; Am I doing something wrong creating the string?

    Read the article

  • Asynchronous NSURLConnection Throws EXC_BAD_ACCESS

    - by Sheehan Alam
    I'm not really sure why my code is throwing a EXC_BAD_ACCESS, I have followed the guidelines in Apple's documentation: -(void)getMessages:(NSString*)stream{ NSString* myURL = [NSString stringWithFormat:@"http://www.someurl.com"]; NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:myURL]]; NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if (theConnection) { receivedData = [[NSMutableData data] retain]; } else { NSLog(@"Connection Failed!"); } } And my delegate methods #pragma mark NSURLConnection Delegate Methods - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { // This method is called when the server has determined that it // has enough information to create the NSURLResponse. // It can be called multiple times, for example in the case of a // redirect, so each time we reset the data. // receivedData is an instance variable declared elsewhere. [receivedData setLength:0]; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { // Append the new data to receivedData. // receivedData is an instance variable declared elsewhere. [receivedData appendData:data]; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { // release the connection, and the data object [connection release]; // receivedData is declared as a method instance elsewhere [receivedData release]; // inform the user NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]); } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { // do something with the data // receivedData is declared as a method instance elsewhere NSLog(@"Succeeded! Received %d bytes of data",[receivedData length]); // release the connection, and the data object [connection release]; [receivedData release]; } I get an EXC_BAD_ACCESS on didReceiveData. Even if that method simply contains an NSLog, I get the error. Note: receivedData is an NSMutableData* in my header file

    Read the article

  • UITextView inside UIScrollView is not First Responder

    - by Sheehan Alam
    I have a UITextView on a View that becomes the first responder. When I embed the UITextView inside of a UIScrollView in Interface Builder the UITextView is no longer the first responder. I am not sure what has changed? - (void)viewDidLoad { [super viewDidLoad]; [scrollView setContentSize:CGSizeMake(540,620)]; composeTextView.delegate = self; [composeTextView becomeFirstResponder]; }

    Read the article

  • View outlet not set with UINavigationController

    - by Sheehan Alam
    I have a NIB that contains a UINavigationController which has a UIViewController. The UIViewController is being loaded externally from another nib. I am unable to set the view property thus I get the error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "LBRootViewController" nib but the view outlet was not set.' How can I set my view property correctly?

    Read the article

  • Dynamic LINQ OrderBy

    - by John Sheehan
    I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a sql-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable<T>. Is there any way to get this functionality on IEnumerable<T>?

    Read the article

  • Unsupported Media Type when deploying OTA Blackberry App

    - by Sheehan Alam
    I have a blackberry app that I am trying to deploy OTA (over the air). I have set the MIME type on my server to be: cod application/vnd.rim.cod jad text/vnd.sun.j2me.app-descriptor jar application/java-archive When I access the JAD file on my web-server through the BlackBerry Browser, I get the message Unsupported Media Type and then a prompt to download the JAD. How can I resolve this?

    Read the article

  • Dismissing a modal view in horizontal orientation?

    - by Sheehan Alam
    I have a modal view that is presented and dismissed fine when my device is in vertical orientation. I have problems when my modal view is presented in the vertical orientation, but dismissed in horizontal orientation. The entire app switches back to vertical orientation automatically. How can I ensure that if I am in horizontal orientation, the view should dismiss properly?

    Read the article

  • How to auto-scroll UITableView?

    - by Sheehan Alam
    I am trying to do something interesting. I am pulling some JSON data and populating cells in a UITableView. How can I make the UITableView scroll ever second or so? I want to give the effect that as new data is coming in, the table is scrolling, so it is streaming. Any ideas?

    Read the article

  • Casting a non-generic type to a generic one

    - by John Sheehan
    I've got this class: class Foo { public string Name { get; set; } } And this class class Foo<T> : Foo { public T Data { get; set; } } Here's what I want to do: public Foo<T> GetSome() { Foo foo = GetFoo(); Foo<T> foot = (Foo<T>)foo; foot.Data = GetData<T>(); return foot; } What's the easiest way to convert Foo to Foo<T>? I can't cast directly InvalidCastException) and I don't want to copy each property manually (in my actual use case, there's more than one property) if I don't have to. Is a user-defined type conversion the way to go?

    Read the article

  • Confused about copying Arrays in Objective-C

    - by Sheehan Alam
    Lets say I have an array X that contains [A,B,C,D,nil]; and I have a second array Y that contains [E,F,G,H,I,J,nil]; If I execute the following: //Append y to x [x addObjectsFromArray:y]; //Empty y and copy x [y removeAllObjects]; y = [x mutableCopy]; What is the value of y? is it?: [A,B,C,D,E,F,G,H,I,J,nil] Am I performing the copy correctly?

    Read the article

  • AddObjectsFromArray does not work properly

    - by Sheehan Alam
    I have two NSMutableArrays: NSMutableArray* currentMessages NSMutableArray* items I am trying to copy the contents of items into currentMessages as such: [self.currentMessages addObjectsFromArray:self.items]; When I am debugging self.items contains 30 objects. After this operation self.currentMessages contains 0 objects. Why is the copy not working?

    Read the article

  • Unable to load detached NIB in View

    - by Sheehan Alam
    I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib contains a UIButton I want ChildViewController.xib to load in the ParentViewController.xib's UIView I have done the following: Created @property for UIView in ParentViewController Connected File's Owner to UIView in ParentViewController Set UIViewController in ParentViewController's NIB Name property to ChildViewController in Interface Builder Set ChildViewController view property to UIView in ParentViewController I was hoping this would load ChildViewController into my UIView in ParentViewController but no luck. I did get the following warning, which could be the culprit: 'View Controller (Child View)' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported. I also have added additional code in ParentViewController's viewDidLoad(): - (void)viewDidLoad { [super viewDidLoad]; ChildViewController *childViewController = [[ChildViewController alloc]initWithNibName:@"ChildViewController" bundle:nil]; childViewController.view = self.myView; } Any thoughts on why ChildViewController does not load in the UIView of ParentViewController?

    Read the article

  • How to detect if certain characters are at the end of an NSString?

    - by Sheehan Alam
    Let's assume I can have the following strings: "hey @john..." "@john, hello" "@john(hello)" I am tokenizing the string to get every word separated by a space: [myString componentsSeparatedByString:@" "]; My array of tokens now contain: @john... @john, @john(hello) For these cases. How can I make sure only @john is tokenized, while retaining the trailing characters: ... , (hello) Note: I would like to be able to handle all cases of characters at the end of a string. The above are just 3 examples.

    Read the article

  • Memory over-release problem when I am animating UIView

    - by Sheehan Alam
    I have enabled NSZombie's and I am getting the following message in my console when I am running my application: *** -[UIViewAnimationState release]: message sent to deallocated instance 0xf96d7e0 Here is the method that is performing the animation -(void)loadAvatar:(STObject*)st { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; avatar.alpha = 0; avatar.frame = avatarRectSmall; avatar.image = [ImageCache getMemoryCachedImageAtUrl:st.avatar_url]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:.50]; avatar.frame = avatarRectNormal; [avatar setAlpha:1]; [UIView commitAnimations]; [pool release]; pool = nil; } I don't always get a crash, only sometimes. I'm wondering what is getting released?

    Read the article

  • Presenting a Popover From a Rect Problem

    - by Sheehan Alam
    I have a UITableViewCell that has some labels and images that can be clicked. I want to present a popover whenever a user clicks on any part of the cell. How can I achieve this without interfering with the click actions of the labels & images? I am currently creating an invisible button ontop of some other clickable items in the cell and calling the popover: [replyPopover presentPopoverFromRect:CGRectMake(77, 25, 408, 68) inView:self permittedArrowDirections: UIPopoverArrowDirectionDown animated:YES]; Unfortunately, because the button is on top of the labels & images I am unable to click them. How can I show a popover by clicking on the background of a cell, so that there is no interference when clicking images & labels inside the cell?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >