Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

finish use pop over

  • Loading branch information...
commit 46df4f1b3190049f8635434a7089882890d73557 1 parent bf9d96b
@sunfmin authored
View
46 _posts/2011-12-17-use-popover-step-by-step.md
@@ -5,6 +5,48 @@ title: Use popover step by step
1. Create a project
-![image](/images/use-pop-over/p1.png)
+ ![image](/images/use-pop-over/p1.png)
+
+1. Drop Popover and View Controller to Objects in Interface Builder
+
+ ![image](/images/use-pop-over/p2.png)
+
+1. Ctrl+N to Create a ViewController named `PopoverViewController`
+
+ ![image](/images/use-pop-over/p3.png)
+
+1. Check the `PopoverViewController.xib` File's Owner to be `PopoverViewController`
+
+ ![image](/images/use-pop-over/p4.png)
+
+1. Change the `MainMenu.xib` Popover View Controller object's Custom Class to be `PopoverViewController`
+
+ ![image](/images/use-pop-over/p5.png)
+
+1. Ctrl Drag `Popover` Object to `Popover View Controller` Object to make `Popover` Object's delegate to be `Popover View Controller`
+
+ ![image](/images/use-pop-over/p6.png)
+
+1. Set `Popover View Controller` object of `MainMenu.xib` 's Nib Name to `PopoverViewController`
+
+ ![image](/images/use-pop-over/p7.png)
+
+
+1. Ctrl Drag `Pop` button to link an Action in `AppDelegate.m`
+
+ ![image](/images/use-pop-over/p8.png)
+
+1. Ctrl Drag `Popover` object to `AppDelegate.h` to make an Outlet
+
+ ![image](/images/use-pop-over/p9.png)
+
+1. Finish the Button Action to pop up work
+
+ - (IBAction)popup:(id)sender {
+ [_popover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:CGRectMinXEdge];
+ }
+
+1. Build and Run
+
+ ![image](/images/use-pop-over/p10.png)
-
View
BIN  images/use-pop-over/p10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/use-pop-over/p2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/use-pop-over/p3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/use-pop-over/p4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/use-pop-over/p5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/use-pop-over/p6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/use-pop-over/p7.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/use-pop-over/p8.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/use-pop-over/p9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.