I'm new to iphone development. I'm a VB programmer who is trying to convert a VB application to an ipad app.
I need some help with sending text to a UITextView.
I want to first have a UIPickerView and then once the user hits a UIButton, a UITextView appears and the text is then generated by my source code code, line by line. The code would constantly be concatenating strings to the text.
It would sort of go like this--
1) User makes selections with UIPickerView.
2) User then hits UIButton.
3) UIPickerView is replaced on the screen with a UITextView.
4) The code does stuff.
5) The code adds the 1st line of text into the UITextView.
6) The code does more stuff.
7) The code then adds the 2nd line of text into the UITextView, retaining the 1st line that was already there.
Steps 6 and 7 are repeated until the code is done.
Does anyone know of any examples of this that I could look at? I am mostly interested in finding something like a youtube video, a webpage that explains the code or even a good book that covers this particular topic. I am finding that the sample codes that Apple has on this site goes over my head.
In fact, I could probably benefit from a good book. But, I am looking for one that I would already know covers this particular topic, since it is so essential to the app that I am trying to build.
Hi
is there a method / possibility to run a function when the scrollview is scrolling?
i found scroll start and scroll end solutions but nothing like a onIsScrolling ...
is there a built in solution? or whats the best workaround (nstimer)?
thanks
Alex
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
Hey Guys,
does anybody know how i can access a custom cell within the - (void)tableView:commitEditingStyle:forRowAtIndexPath:. I need access to my Custom Cell Class to retrieve some parameters.
Thanks.
I have a webview over a scrollview as subview. The problem is that, webview does not scroll vertically, when I try to do so scroll view start scrolling, is there any way to do so that when I touch on the webview it shoul scroll and if I touch outside of webview scrollview should scroll?
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.
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;
}
I'm sure this is some easy-to-fix issue that I've missed, but I can't figure it out. I've got a grouped table view with 3 sections. I'm using the following code to generate section headers:
-(NSString*)tableView:(UITableView*)tableView titleForHeaderInSection:(NSInteger)section {
if (section == 0) {
NSString *header = @"Header 1";
return header;
}
if (section == 1) {
NSString *header = @"Header 2";
return header;
}
else {
NSString *header = @"Header 3";
return header;
}
}
When my table is displayed, there are two headers for each section - one with white text on a gray bar that stretches across the screen (like the letter separators in the Contacts app), and one in gray text on the table background (which is the one I want). Both headers have identical text. Where is the first header coming from?
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
Hi
I have one main view where I display an image, in the method viewDidLoad:
ballRect = CGRectMake(posBallX, 144, 32.0f, 32.0f);
theBall = [[UIImageView alloc] initWithFrame:ballRect];
[theBall setImage:[UIImage imageNamed:@"ball.png"]];
[self.view addSubview:theBall];
[laPalla release];
Obviously, the value of posBallX is defined and then update via a custom method call many times in the same class.
theBall.frame = CGRectMake(posBallX, 144, 32, 32);
Everything works, but when I go to another view with
[self presentModalViewController:viewTwo animated:YES];
and come back with
[self presentModalViewController:viewOne animated:YES];
the image is displayed correctly after the method viewDidLoad is called (I retrieve the values with NSUserDefaults) but no more in the second method. In the NSLog I can even see the new posBallX updating correctly, but the Image is simply no more shown...
The same happens with a Label as well, which should print the value of posBallX.
So, things are just not working if I come back to the viewOne from the viewTwo... Any idea???????
Thanks so much!
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.
hi all friends,
I am making a game application in that I want to pass my score on wall of face book. I've completed all the things (the log in and message passing part) but when I passes the score via global variable, I am getting only null as a value and not the score that I want.
Is there any way to pass data or string to Face book and write on a wall?
My code is
(void)viewDidLoad {
static NSString* kApiKey = @"be60415be308e2b44c0ac1db83fe486b";
static NSString* kApiSecret = @"4f880c7e100321f808c41b1d3c813dfa";
_session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain];
score = [NSString stringWithFormat:@"%@",appDelegate.myTextView];
[_session resume];
[super viewDidLoad];
}
whre score is NSString and myTextView is NSString in other viewcontrollerfile, And appDelegate is global variable.
Any help??
thanks in advance.
Hi,
I want to play the podcasts those are available on itunes from my application.
Is there anyway to play podcasts within my appplication?
Thanks,
Jim.
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.
Hi,
I am working on an App that is already been made but Memory Management was not considered in the development stages.
So what can I do to keep the App memory usage low as soon as I get a memory warning?
Is there any general tool or some piece of code that I can use to release any unused memory?
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.
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 |
+-------------------------+ +-------------------------+
Hi there,
I'm working on an iPad app and here's my scenario:
I have a view which contains a table view inside of it. When the user selects an item on the table view, I would like the parent's view to change in a navigational manner. For those of you that have an iPad, this would be akin to the "Settings" app. But I guess in the "Settings" app, the right pane is composed of a grouped table view right?
Is what I'm trying to do possible?
Thanks
Hi All,
I am trying to use some external Framework in my iPhone app. I did the following:
copied the xxx.framework inside my project folder
dragged the xxx.framework folder to Frameworks folder in xcode
clicked add to target and set the path to relative to the project
passed -ObjC flag in other flags (required by the framework)
when compiling i get the error "ld: framework not found xxx.framework"
what could I possibly missed?
I googled around to find an answer and no luck so far and I need to make it work urgently
any help will be much appreciated
Thanks Alot
Yas.
I'm trying to scrape the entire iTunes App Store so that I can store it in a database for a project I'm working on. I'm having a hard time finding the best way to do this. I know there are ways to get specific information about price changes but I can't find anything that describes how to scrape the entire app store.
Any additional info is appreciated.
I have an array that contains the RGB colour values for each pixel in a 320 x 180 display. I would like to be able to set individual pixel values in the a bitmap context of the same size offscreen then display the bitmap context in a view.
It appears that I have to create 1x1 rects and either put a stroke on them or a line of length 1 at the point in question. Is that correct? I'm looking for a very efficient way of getting the array data onto the graphics context as you can imagine this is going to be an image buffer that cycles at 25 frames per second and drawing in this way seems inefficient.
I guess the other question is should I use OPENGL ES instead?
Thoughts/best practice would be much appreciated.
Regards
Dave
OK, have come a short way, but can't make the final hurdle and I am not sure why this isn't working:
- (void) displayContentsOfArray1UsingBitmap: (CGContextRef)context
{
long bitmapData[WIDTH * HEIGHT];
// Build bitmap
int i, j, h;
for (i = 0; i < WIDTH; i++)
{
for (j = 0; j < HEIGHT; j++)
{
h = frameBuffer01[i][j];
bitmapData[i * j] = h;
}
}
// Blit the bitmap to the context
CGDataProviderRef providerRef = CGDataProviderCreateWithData(NULL, bitmapData,4 * WIDTH * HEIGHT, NULL);
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGImageRef imageRef = CGImageCreate(WIDTH, HEIGHT, 8, 32, WIDTH * 4, colorSpaceRef, kCGImageAlphaFirst, providerRef, NULL, YES, kCGRenderingIntentDefault);
CGContextDrawImage(context, CGRectMake(0.0, HEIGHT, WIDTH, HEIGHT), imageRef);
CGImageRelease(imageRef);
CGColorSpaceRelease(colorSpaceRef);
CGDataProviderRelease(providerRef);
}
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?
The title of this question should be pretty self explanatory. I am making an app that involves multiple UIImageViews that serve the same purpose. They are merely different sizes. Anyway, I decided that the best solution was to make UIImageView subclasses, link the subcalsses in IB, and work from there. My code should explain this better -
#define kPausedStatePaused 1
#define kPausedStatePlay 2
#import "Game.h"
#import "ScoreSystem.h"
@interface Doctor : UIImageView
{
}
@end
@interface Ground : UIImageView
{
}
@end
@interface Wall : UIImageView
{
}
@end
@interface Electric_Wire : UIImageView
{
}
@end
@implementation Game
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
}
return self;
}
*/
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/
- (IBAction)pause {
UIAlertView *pause = [[UIAlertView alloc] initWithTitle:@"Pause" message:nil delegate:self cancelButtonTitle:@"Quit" otherButtonTitles:@"Play", nil];
[pause show];
[pause release];
pauseint = kPausedStatePaused;
}
- (void)viewDidAppear {
pauseint = kPausedStatePlay;
}
- (void)loop {
Doctor *doctorview;
Ground *groundview;
if (CGRectIntersectsRect(doctorview, groundview)) {
}
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if ([alertView.title isEqual:@"Pause"]) {
if(buttonIndex == 0)
[self dismissModalViewControllerAnimated:YES];
pauseint = kPausedStatePlay;
}
}
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end
Unsurprisingly, Xcode gave me an "incompatible type for CGRectIntersectsRect" error.