Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-19-2011, 08:43 PM   #1 (permalink)
Mohammad Kalim
 
Join Date: Mar 2010
Location: Karachi, Pakistan
Posts: 37
mk_fastian is on a distinguished road
Default Which method is accessible when moved to previous View

I have 2 views:

In the first view I have added another view:

[self.view addSubView:self.secondView];

In Second View when i Press Back then i have remove the second view for back to the first View

[self.view removeFromSuperView];

but in my first view there is the UITableView I have to use `[UITableView reloadData];` method of UITableView but I don't know which method is called when secondView is removed.

My main objective is to call some method when I remove the second view and call any method which will reload the data.

Thanking in advance.
__________________
AppzVenture

Intel Core i5 Macbook Pro, iPhone/iPad Application Development at AppzVenture
mk_fastian is offline   Reply With Quote
Old 08-20-2011, 01:23 AM   #2 (permalink)
Mohammad Kalim
 
Join Date: Mar 2010
Location: Karachi, Pakistan
Posts: 37
mk_fastian is on a distinguished road
Default Regarding Question

Please some one i am very thankful...

BumpBumpBump
__________________
AppzVenture

Intel Core i5 Macbook Pro, iPhone/iPad Application Development at AppzVenture
mk_fastian is offline   Reply With Quote
Old 08-20-2011, 08:53 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 557
Joseph Nardone is on a distinguished road
Default

Quote:
Originally Posted by mk_fastian View Post
Please some one i am very thankful...

BumpBumpBump
If you present the second view as a modal view then the ViewWillAppear method of your first view will be called when your second view is dismissed.
Joseph Nardone is offline   Reply With Quote
Old 08-20-2011, 08:59 AM   #4 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mk_fastian View Post
I have 2 views:

In the first view I have added another view:

[self.view addSubView:self.secondView];

In Second View when i Press Back then i have remove the second view for back to the first View

[self.view removeFromSuperView];

but in my first view there is the UITableView I have to use `[UITableView reloadData];` method of UITableView but I don't know which method is called when secondView is removed.

My main objective is to call some method when I remove the second view and call any method which will reload the data.

Thanking in advance.

When you talk about "first view" and "second view" and back buttons, it sounds like you're using view controllers. However, you're adding and removing views manually.

You should really use a navigation controller or tab bar controller and let those objects manage switching view controllers for you.

It is possible to add an reviews manually within a single view controller, but I don't recommend it for a beginner.

You should not mix views from one view controller with views from another view controller.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 08-20-2011, 12:21 PM   #5 (permalink)
Mohammad Kalim
 
Join Date: Mar 2010
Location: Karachi, Pakistan
Posts: 37
mk_fastian is on a distinguished road
Default regarding Duncan reply...

Quote:
Originally Posted by Duncan C View Post
When you talk about "first view" and "second view" and back buttons, it sounds like you're using view controllers. However, you're adding and removing views manually.

You should really use a navigation controller or tab bar controller and let those objects manage switching view controllers for you.

It is possible to add an reviews manually within a single view controller, but I don't recommend it for a beginner.

You should not mix views from one view controller with views from another view controller.
Fist a fall i am not mixing the viewControllers and i am also not the beginners but i am also not expert .. :-) but every middle man need help to make him expert .. so i need a solution sir or is it possible some tricks to do that.. ??
__________________
AppzVenture

Intel Core i5 Macbook Pro, iPhone/iPad Application Development at AppzVenture
mk_fastian is offline   Reply With Quote
Old 08-20-2011, 03:02 PM   #6 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mk_fastian View Post
Fist a fall i am not mixing the viewControllers and i am also not the beginners but i am also not expert .. :-) but every middle man need help to make him expert .. so i need a solution sir or is it possible some tricks to do that.. ??
If you want help you're going to have to paint a more complete picture.

You have a view that adds a second view in certain cases. What triggers you to add the second view? Does the second view cover part or all of the first view's original contents?

Where is all of this control logic? Is it in a single view controller, that adds and removes views as needed?

Are you saying that you put a back button on the second view? Do you have an IBAction method on that back button? If so, what is the code for that action? Where does that action live? In the view controller object?

I gather that you want the back button to remove the second view. It would makes sense to have the back button action do the removing, and also update the table view if it needs to.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Reply

Bookmarks

Tags
removefromsuperview, uiview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 398
13 members and 385 guests
7twenty7, chiataytuday, cristofercolmbos, dedeys78, fiftysixty, gmarro, iOS.Lover, jonathandeknudt, raymng, stanny, tymex, UMAD, xerohuang
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:12 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0