Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Button action event
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="sagarshivam" data-source="post: 1259375" data-attributes="member: 203583"><p>Dear All!</p><p></p><p>In my very first iPhone App< i am trying to create one button(through code and not using IB) and then clicking that button, will read some file (file name is hard coded in the program) from local machine and will display the content on the iPhone.</p><p></p><p>I created button as:</p><p></p><p>- (void)loadView</p><p>{</p><p> UIView *contentView = [[UIView alloc] initWithFrame<img src="/mac_images/images/smilies/Embarrassed.png" class="smilie" loading="lazy" alt=":[" title="Embarrassed :[" data-shortname=":[" />[UIScreen mainScreen] applicationFrame]];</p><p> self.view = contentView;</p><p> </p><p> contentView.backgroundColor = [UIColor whiteColor];</p><p> contentView.multipleTouchEnabled= TRUE;</p><p> [contentView release];</p><p> </p><p> // Add an action button</p><p> self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]</p><p> initWithTitle<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"Browse" </p><p> style:UIBarButtonItemStylePlain </p><p> target:self </p><p> action<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />selector(presentSheet)] autorelease];</p><p></p><p>}</p><p></p><p></p><p>where "presentsheet" is a function that will include file opening and reading code.</p><p></p><p>Am I doing right? How to proceed in "presentsheet"?</p><p></p><p>Thnx in advance</p></blockquote><p></p>
[QUOTE="sagarshivam, post: 1259375, member: 203583"] Dear All! In my very first iPhone App< i am trying to create one button(through code and not using IB) and then clicking that button, will read some file (file name is hard coded in the program) from local machine and will display the content on the iPhone. I created button as: - (void)loadView { UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; self.view = contentView; contentView.backgroundColor = [UIColor whiteColor]; contentView.multipleTouchEnabled= TRUE; [contentView release]; // Add an action button self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Browse" style:UIBarButtonItemStylePlain target:self action:@selector(presentSheet)] autorelease]; } where "presentsheet" is a function that will include file opening and reading code. Am I doing right? How to proceed in "presentsheet"? Thnx in advance [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Button action event
Top