After going into Edit mode, moving a cell, and leaving edit mode, i am left with one extra cell sitting on top of its duplicate cell while still in edit mode.
The problem has to be somewhere in here:
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath {
NSMutableArray *array = [[fetchedResultsController fetchedObjects] mutableCopy];
id objectToMove = [[array objectAtIndex:sourceIndexPath.row] retain];
[array removeObjectAtIndex:sourceIndexPath.row];
[array insertObject:objectToMove atIndex:destinationIndexPath.row];
[objectToMove release];
for (int i=0; i<[array count]; i++) {
[(NSManagedObject *)[array objectAtIndex:i] setValue:[NSNumber numberWithInt:i] forKey:@"userOrder"];
}
[array release];
}
Any guidance greatly appreciated!
I've got the following class that is a wrapper around an ABPerson (ABRecordRef):
@interface Recipient : NSObject {
ABRecordRef person;
}
- (id)initWithPerson:(ABRecordRef)person;
@end
@implementation
- (id)initWithPerson:(ABRecordRef)_person {
if(self = [super init]) person = CFRetain(_person);
return self;
}
- (void)dealloc {
if(person) CFRelease(person);
[super dealloc];
}
@end
I've left some of the methods out, but they aren't relevant to this question.
Everything works fine, except I get an EXC_BAD_ACCESS on the if(person) CFRelease(person); line. Why does this happen? I'm not calling CFRelease or CFRetain at all anywhere else in my app.
Hi there!
I got a huge problem with the Android Development Tools ADT running in Eclipse Galileo (3.5.1) on Ubuntu 9.10, 64bit.
On this platform, I do not manage to see any property edit dialogs for layout properties. E.g. the one where you can select a string resource ID for text fields, or a drawable ID for image fields or backgrounds.
Whenever I click on the ... button next to the property value - nothing happens, except this button disappears.
Properties with a list of possible values, e.g. "wrap_content" or "fill_parent" are displayed in a dropdown box directly in the properties field.
On a different system I work in a Windows environment with Eclipse 3.4 and the same ADT: no problems whatsoever, everything works fine, the dialogs come perfectly.
Does anyone know what to do here? Where's the problem? Why does Eclipse not tell me that something goes wrong?
Thanks!
NEW DISCOVERIES: I found out that it might not even be an Android problem, but a general Eclipse problem that I can see with all version (Ganymede, Galileo, Helios) on my Linux (Ubuntu) system. It must be a simple UI problem: the button with ... next to the values does not receive the mouse click!! I managed to see the appropriate dialogs to edit the property values by doubleclicking the button - crazy, strange, ugly behavior! But why on earth does nobody else know about this problem - I cannot find anything else on the net about it! Could it be related to this strange "GDK native window problem" on Gnome? HELP!
Hi
I can see that this is something that has been troubling a lot of people:/
I have a UITabBarController that has 4 viewControllers, all of type UINavigationController.
One of the navigationControllers gets a viewController pushed onto its stack, this viewController should be presented in landscape mode/orientation.
The viewController is a graph, it is the absolutely only place in the app where landscape makes sense. (I hide the UITabBar when this is presented to not lead the user to believe this will work everywhere)
To make a UITabBarController respond correctly to changes in orientation all its viewControllers need to return the same value from the delegate method:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
So to accomodate this behavior I have implemented this method in all the viewControllers belonging to the UITabBarController:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BOOL canRotate = [defaults boolForKey:@"can_rotate"];
return canRotate;
}
The "trick" is now that when my can-be-landscape viewController is pushed I do this:
- (void) viewWillAppear:(BOOL)animated {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:YES forKey:@"can_rotate"];
[defaults synchronize];
}
and when it is popped, I do this:
- (void) viewWillDisappear:(BOOL)animated {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:NO forKey:@"can_rotate"];
[defaults synchronize];
}
This works really well. When the viewController is on the stack I can rotate the device and the view follows.
The problem is however, that if the user taps the "back" button on the navigationBar while in landscape mode, thus popping the viewController to the previous viewController, this "old" viewController is of course also in landscape mode. To make things worse, because I set the BOOL to NO, this "old" viewController can not rotate back when I orientate the device to portrait mode.
Is there a way to update everything so that none of my other viewControllers will be in landscape mode when I pop the can-be-in-landscape mode viewController?
I am a bit worried that if this could be done from landscape to portrait it should also be possible from portrait to landscape, thus making my "hack" unnecessary.. but if it can not, then I am back to square one :/
Hope I am close and that someone could help me get there, thanks:)
I was just curious, is it possible to have direct network transfers in c#, without local caching.
e.g.
I have response stream which represents GoogleDrive file and request stream to upload file to another GoogleDrive account.
At that momment I can download file to local pc and next upload it to the google drive. But is it possible to upload it directly from one google drive to another or, at least, start uploading before full download will be completed.
Thank
hey guys
When you have an iPad Project, and you want to put a table view in your landscape view...
I did this
i dragged in a UITableView.
but what do you 'hook' the data source to? there are about 3 options that all seem to crahing for me...
when not hooked up, app launches fine.
Any help would be appreciated.
Cheers
Sam
Hey
is there any way to send whats in a text view (im trying to make a suggestion box) to my email address?
example
user types in the box " I think you should add twitter support"
then that is sent in the background to my email address [email protected]
then a message is popped up on the screen saying "suggestion sent"
just an example of what i mean
Any ideas, tutorial links would be greatly appreciated guys
Thanks
I am having MKAnnotationView and i have added UIButton to it, by addSubView method with IBAction assigned to it using addTarget method. But when i tabbed on that button IBAction doesn't called ....!
I am not getting, Why it is not working?
How can i add button to MKannotationView so that its IBAction called ???
Plz. help me.
Thanks
Chinese characters can be view horizontally and vertically. I want to let users have both options. How can this be done in an iPhone views?
e.g.
+-------------------------+ +-------------------------+
| Hello, I am a newbie. | | b a H |
| | | i m e |
| | | e l |
| | ---> | . a l |
| | | o |
| | | n , |
| | | e |
| | | w I |
+-------------------------+ +-------------------------+
I would like to add a button "Vote Us" that opens App Store and brings automatically users to my app review page where they can vote my app.
How can I do it?
My application was rejected from Apple today.Apple says that the video stream should be not more than at 64kbps.
what should i will have to do get my application approve on App Store?? Should i have to make changes on video content that i am streaming from my iPhone or should i have to change in code?
Please suggest.
Thanks,
Jim.
hi im new i have a UITextView field on a view and when i orientate the iphone to the right side the keyboard doestn move it stays horizontal. how do i make it move along?
Hi there,
I'm overwriting UINavigationController to replace the default navigationBar property with an instance of my own subclass of UINavigationBar. So I tried something like
_navigationBar = [[SBNavigationBar alloc] init];
in my -initWithRootViewController:. But that didn't work out as I expected it. There's still the default navigationBar being displayed.
So what's the best point to overwrite the navigationBar?
Thanks in advance
–f
I have a UIView with another UIView inside it. On the inside UIView there is a textbox which I want to fill in. When I try to fill it in the keyboard blocks my view:
The UIViewController has the following
containerView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.view=containerView;
//The apropriate releases etc are further on...
When I touch it, the keyboard comes up as expected, but blocks the textbox I'm trying to fill in. How can I force the view to slide up?
The front view
OptionsFront * fv = [[OptionsFront alloc] initWithFrame:[UIScreen mainScreen].bounds];
[containerView addSubview:frontView];
In the front view is a subview
CGRect bounds = CGRectMake(0.0f, 210.0f, 280.0f, 130.0f);
sv = [[UIView alloc] initWithFrame:bounds];
[self addSubview:sv]; //added to frontView
In sv is a textbox near the botton:
rect = CGRectMake(70.0f, 20.0f, 100.0f, 27.0f);
cf = [self createTextField_Rounded:rect holder:@"+ve"];
[sv addSubview:cf];
So cf happens to be near the bottom of the page. I expected that when I select it, the whole display would move up, but the keyboard just moves up and blocks it.
What can I do?
Appendix:
- (UITextField *)createTextField_Rounded:(CGRect) frame holder:(NSString *) ph
{
UITextField *returnTextField = [[UITextField alloc] initWithFrame:frame];
returnTextField.borderStyle = UITextBorderStyleRoundedRect;
returnTextField.textColor = [UIColor blackColor];
returnTextField.font = [UIFont systemFontOfSize:17.0];
returnTextField.delegate = self;
returnTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
returnTextField.returnKeyType = UIReturnKeyDone;
returnTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
return returnTextField;
}
Hello,
I would like to create a search field exactly as the one in Mail application. The field is first hided, and when an user scrolls down, it appears. Could you help me and give some directions where to look for ?
Thank you very much in advance.
I am interested in learning how to program game graphics for iPhone OS (3.x and beyond...). Can anyone recommend (based on personal experience) good books/websites that deal specifically with Quartz/OpenGL ES programming.
Thanks.
hi friends,
I want to move an object over the screen where ever the touch moves, i.e. If I touch and drag my finger then the object should get moved, if any one know about this how to perform, please let me know.
Thank you in advance, vira.
I have a Core Data based application that stores hierarchal data displayed using a series of UITableViews. To illustrate my app functionality to the user I would like to pre-populate my database/app with some dummy values. This data would be available upon installation on the user's iPhone/iPod Touch.
What is the best way to achieve this?
Hello guys!
Do you have any idea how can I test if the scrollview is bouncing? So is there a notification or something when the bounce ends?
Thanks in forward!
How do I get the contents of the documents directory as a NSMutableArray?
I can get it as a normal NSArray, but as soon as I try to do anything with that array, my app crashes.
Thanks
ive set the shouldAutorotateToInterfaceOrientation to return to YES for orientation then i noticed as the iphone rotates the background rotates as well which is a UIImageView. how do i have the background fixed so it doesnt rotate?
I have been testing my iPhone debug build on both my device and simulator with activity monitor, leaks, and object allocations. The code is pretty well optimized so I have decided to test the release build. I went into the project Menu and set the target build to be release, I then added the necessary header paths that my app is using to the headers search paths and ran the release build on the device with the above mentioned instruments. What I have noticed now is that memory that was freed when I used the debug build does not get freed when using release version. There is one place in my App that I remove a scroll view with some images which frees up a significant amount of memory when I use the debug build, but no memory is freed up in that place when I use the release version. Does someone have any ideas where I need to start looking at? did I setup my release build wrong?
In a new app, I plan to let users download their own files and stored them inside iPhone. The process is typically:
iPhone present a web page by UIWebView, in which there are several links to .zip files
the user browser the page and click on one of the .zip file link
iPhone downloads the file into the iPhone document folder, closes WebView, acknowledges the user when download is complete
How can that be done? Thanks
Hi,
This is a bit of an odd/specific one - possibly a bug?
I'm using MPMoviePlayerViewController to play a variety of files, including Enhanced Podcasts - these are audio files, but with a slideshow of images, often created using GarageBand. Until (i think) iOS 3.2 they weren't supported at all, now they are and play fine in the iPod app, but in my app the slideshow doesn't start, the full screen movie player opens, and the audio begins, but all I see is the QuickTime logo. If I scrub the track the pictures appear - and will continue to play correctly - but I see nothing if I don't scrub!
Any ideas??
On a related note, these files also include a small rectangluar button containing an (i) button on the right hand side - anybody know what it is or should do?! It does nothing for me!