Thursday, December 26, 2013

How to call methods in the class?

SwitchViewController class has a method
- (IBAction) switchDetailViews: (id) sender
{
}


Want to achieve clicking tableview row to display a view,

- (Void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {
SwitchViewController * switchViewController = [[SwitchViewController alloc] init];
[SwitchViewController switchViews];
[SwitchViewController release];
}

But can not be displayed. Button in the interface to connect directly to switchViews This method can be performed
Reply:
Show No, I guess because currently loaded View is tableView, or need flip cover this tableView.
Click on a line will certainly trigger
- (Void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
Here try
UIView * v = [[UIView alloc] initWithFrame: CGRectMake (0, 0, 300, 300)];
v.backgroundColor = [UIColor purpleColor];
[Self.view addSubview: v];

Reply:
cited a floor ybh37 reply:
not show, I guess because currently loaded View is tableView, need to flip or override this tableView.
Click on a line will certainly trigger
- (Void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
Here try
UIView * v = [[UIView alloc] initWith ......


Click OK when there will be such a view obscured tableview
Reply:
reference to the second floor zzxap reply:
cited a floor ybh37 reply:

Show No, I guess because currently loaded View is tableView, or need flip cover this tableView.
Click on a line will certainly trigger
- (Void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
Here try
UIView * v = [[U ......
certainly be obscured, you can set the View pop-up location.
Reply:
For ah, you do not just want to achieve clicking tableview row, showing a view ⋯ ⋯
You put that View a change is ah.
To http://www.cocoachina.com/
Search UItableview you want to see if there are examples ⋯ ⋯
Reply:
Method of switching the view I have enclosed in another class, just call on the line.

But it looks like the call or not, the view is not switching.

With a button to connect to the method can switch views
Reply:
references, 5th Floor zzxap reply:
method of switching the view I've encapsulated in another class, just call on the line.

But it looks like the call or not, the view is not switching.

With a button to connect to the method can switch views

Right now, not without execution is not loaded in the current master View.
Do not believe you can add breakpoints to see.
[SwitchViewController switchViews];
You use this method returns a View
Then try again addsubview loaded about
⋯ ⋯ ⋯ ⋯
I'll give you a code to tell you definitely can perform, but not correctly loaded view. You do not understand
Reply:
Think about it, switchViewController this class, unless you use the notice, otherwise, it can not control the load current display class action to do it
So I feel can not be loaded on your definition of View
Reply:
reference to the 7th floor ybh37 reply:
Think about it, switchViewController this class, unless you use the notice, otherwise, it can not be done to control the current display class Load the action bar
So I feel can not be loaded on your definition of View

Teachable. . .
Reply:
Shucks ⋯ ⋯
I was just getting started ⋯ ⋯

Reply:
reference to the 9th floor ybh37 reply:
Shucks ⋯ ⋯
I was just getting started ⋯ ⋯

You are an experienced expert, and I still feel the threshold
Reply:
Well, I recommend that book, you read it? iPhone development Cheats 2
There are many examples of that on top, although there are many translation errors, generally speaking, is good.
According to the book and thought the hand is good ~
Reply:
https://github.com/erica/iphone-3.0-cookbook-/tree
Code book here ⋯ ⋯

No comments:

Post a Comment