Skip to content

Commit ea37e36

Browse files
committed
OC与JS交互的一个简单、经典的例子。
1 parent 45d1f24 commit ea37e36

24 files changed

+1060
-0
lines changed
Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
65A456C21754428100B5A837 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65A456C11754428100B5A837 /* UIKit.framework */; };
11+
65A456C41754428100B5A837 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65A456C31754428100B5A837 /* Foundation.framework */; };
12+
65A456C61754428100B5A837 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65A456C51754428100B5A837 /* CoreGraphics.framework */; };
13+
65A456CC1754428100B5A837 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 65A456CA1754428100B5A837 /* InfoPlist.strings */; };
14+
65A456CE1754428100B5A837 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 65A456CD1754428100B5A837 /* main.m */; };
15+
65A456D21754428100B5A837 /* njwAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 65A456D11754428100B5A837 /* njwAppDelegate.m */; };
16+
65A456D41754428100B5A837 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 65A456D31754428100B5A837 /* Default.png */; };
17+
65A456D61754428100B5A837 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 65A456D51754428100B5A837 /* Default@2x.png */; };
18+
65A456D81754428100B5A837 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 65A456D71754428100B5A837 /* Default-568h@2x.png */; };
19+
65A456DB1754428100B5A837 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65A456D91754428100B5A837 /* MainStoryboard.storyboard */; };
20+
65A456DE1754428100B5A837 /* njwViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 65A456DD1754428100B5A837 /* njwViewController.m */; };
21+
65A456E517544C5B00B5A837 /* webviewContent.html in Resources */ = {isa = PBXBuildFile; fileRef = 65A456E417544C5B00B5A837 /* webviewContent.html */; };
22+
/* End PBXBuildFile section */
23+
24+
/* Begin PBXFileReference section */
25+
65A456BE1754428100B5A837 /* NativeJsWebView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NativeJsWebView.app; sourceTree = BUILT_PRODUCTS_DIR; };
26+
65A456C11754428100B5A837 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
27+
65A456C31754428100B5A837 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
28+
65A456C51754428100B5A837 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
29+
65A456C91754428100B5A837 /* NativeJsWebView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NativeJsWebView-Info.plist"; sourceTree = "<group>"; };
30+
65A456CB1754428100B5A837 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
31+
65A456CD1754428100B5A837 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32+
65A456CF1754428100B5A837 /* NativeJsWebView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NativeJsWebView-Prefix.pch"; sourceTree = "<group>"; };
33+
65A456D01754428100B5A837 /* njwAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = njwAppDelegate.h; sourceTree = "<group>"; };
34+
65A456D11754428100B5A837 /* njwAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = njwAppDelegate.m; sourceTree = "<group>"; };
35+
65A456D31754428100B5A837 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
36+
65A456D51754428100B5A837 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
37+
65A456D71754428100B5A837 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
38+
65A456DA1754428100B5A837 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = "<group>"; };
39+
65A456DC1754428100B5A837 /* njwViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = njwViewController.h; sourceTree = "<group>"; };
40+
65A456DD1754428100B5A837 /* njwViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = njwViewController.m; sourceTree = "<group>"; };
41+
65A456E417544C5B00B5A837 /* webviewContent.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = webviewContent.html; sourceTree = "<group>"; };
42+
/* End PBXFileReference section */
43+
44+
/* Begin PBXFrameworksBuildPhase section */
45+
65A456BB1754428100B5A837 /* Frameworks */ = {
46+
isa = PBXFrameworksBuildPhase;
47+
buildActionMask = 2147483647;
48+
files = (
49+
65A456C21754428100B5A837 /* UIKit.framework in Frameworks */,
50+
65A456C41754428100B5A837 /* Foundation.framework in Frameworks */,
51+
65A456C61754428100B5A837 /* CoreGraphics.framework in Frameworks */,
52+
);
53+
runOnlyForDeploymentPostprocessing = 0;
54+
};
55+
/* End PBXFrameworksBuildPhase section */
56+
57+
/* Begin PBXGroup section */
58+
65A456B51754428100B5A837 = {
59+
isa = PBXGroup;
60+
children = (
61+
65A456C71754428100B5A837 /* NativeJsWebView */,
62+
65A456C01754428100B5A837 /* Frameworks */,
63+
65A456BF1754428100B5A837 /* Products */,
64+
);
65+
sourceTree = "<group>";
66+
};
67+
65A456BF1754428100B5A837 /* Products */ = {
68+
isa = PBXGroup;
69+
children = (
70+
65A456BE1754428100B5A837 /* NativeJsWebView.app */,
71+
);
72+
name = Products;
73+
sourceTree = "<group>";
74+
};
75+
65A456C01754428100B5A837 /* Frameworks */ = {
76+
isa = PBXGroup;
77+
children = (
78+
65A456C11754428100B5A837 /* UIKit.framework */,
79+
65A456C31754428100B5A837 /* Foundation.framework */,
80+
65A456C51754428100B5A837 /* CoreGraphics.framework */,
81+
);
82+
name = Frameworks;
83+
sourceTree = "<group>";
84+
};
85+
65A456C71754428100B5A837 /* NativeJsWebView */ = {
86+
isa = PBXGroup;
87+
children = (
88+
65A456D01754428100B5A837 /* njwAppDelegate.h */,
89+
65A456D11754428100B5A837 /* njwAppDelegate.m */,
90+
65A456D91754428100B5A837 /* MainStoryboard.storyboard */,
91+
65A456DC1754428100B5A837 /* njwViewController.h */,
92+
65A456DD1754428100B5A837 /* njwViewController.m */,
93+
65A456C81754428100B5A837 /* Supporting Files */,
94+
);
95+
path = NativeJsWebView;
96+
sourceTree = "<group>";
97+
};
98+
65A456C81754428100B5A837 /* Supporting Files */ = {
99+
isa = PBXGroup;
100+
children = (
101+
65A456C91754428100B5A837 /* NativeJsWebView-Info.plist */,
102+
65A456CA1754428100B5A837 /* InfoPlist.strings */,
103+
65A456CD1754428100B5A837 /* main.m */,
104+
65A456CF1754428100B5A837 /* NativeJsWebView-Prefix.pch */,
105+
65A456D31754428100B5A837 /* Default.png */,
106+
65A456D51754428100B5A837 /* Default@2x.png */,
107+
65A456D71754428100B5A837 /* Default-568h@2x.png */,
108+
65A456E417544C5B00B5A837 /* webviewContent.html */,
109+
);
110+
name = "Supporting Files";
111+
sourceTree = "<group>";
112+
};
113+
/* End PBXGroup section */
114+
115+
/* Begin PBXNativeTarget section */
116+
65A456BD1754428100B5A837 /* NativeJsWebView */ = {
117+
isa = PBXNativeTarget;
118+
buildConfigurationList = 65A456E11754428100B5A837 /* Build configuration list for PBXNativeTarget "NativeJsWebView" */;
119+
buildPhases = (
120+
65A456BA1754428100B5A837 /* Sources */,
121+
65A456BB1754428100B5A837 /* Frameworks */,
122+
65A456BC1754428100B5A837 /* Resources */,
123+
);
124+
buildRules = (
125+
);
126+
dependencies = (
127+
);
128+
name = NativeJsWebView;
129+
productName = NativeJsWebView;
130+
productReference = 65A456BE1754428100B5A837 /* NativeJsWebView.app */;
131+
productType = "com.apple.product-type.application";
132+
};
133+
/* End PBXNativeTarget section */
134+
135+
/* Begin PBXProject section */
136+
65A456B61754428100B5A837 /* Project object */ = {
137+
isa = PBXProject;
138+
attributes = {
139+
CLASSPREFIX = njw;
140+
LastUpgradeCheck = 0460;
141+
ORGANIZATIONNAME = "Peter Traeg";
142+
};
143+
buildConfigurationList = 65A456B91754428100B5A837 /* Build configuration list for PBXProject "NativeJsWebView" */;
144+
compatibilityVersion = "Xcode 3.2";
145+
developmentRegion = English;
146+
hasScannedForEncodings = 0;
147+
knownRegions = (
148+
en,
149+
);
150+
mainGroup = 65A456B51754428100B5A837;
151+
productRefGroup = 65A456BF1754428100B5A837 /* Products */;
152+
projectDirPath = "";
153+
projectRoot = "";
154+
targets = (
155+
65A456BD1754428100B5A837 /* NativeJsWebView */,
156+
);
157+
};
158+
/* End PBXProject section */
159+
160+
/* Begin PBXResourcesBuildPhase section */
161+
65A456BC1754428100B5A837 /* Resources */ = {
162+
isa = PBXResourcesBuildPhase;
163+
buildActionMask = 2147483647;
164+
files = (
165+
65A456CC1754428100B5A837 /* InfoPlist.strings in Resources */,
166+
65A456D41754428100B5A837 /* Default.png in Resources */,
167+
65A456D61754428100B5A837 /* Default@2x.png in Resources */,
168+
65A456D81754428100B5A837 /* Default-568h@2x.png in Resources */,
169+
65A456DB1754428100B5A837 /* MainStoryboard.storyboard in Resources */,
170+
65A456E517544C5B00B5A837 /* webviewContent.html in Resources */,
171+
);
172+
runOnlyForDeploymentPostprocessing = 0;
173+
};
174+
/* End PBXResourcesBuildPhase section */
175+
176+
/* Begin PBXSourcesBuildPhase section */
177+
65A456BA1754428100B5A837 /* Sources */ = {
178+
isa = PBXSourcesBuildPhase;
179+
buildActionMask = 2147483647;
180+
files = (
181+
65A456CE1754428100B5A837 /* main.m in Sources */,
182+
65A456D21754428100B5A837 /* njwAppDelegate.m in Sources */,
183+
65A456DE1754428100B5A837 /* njwViewController.m in Sources */,
184+
);
185+
runOnlyForDeploymentPostprocessing = 0;
186+
};
187+
/* End PBXSourcesBuildPhase section */
188+
189+
/* Begin PBXVariantGroup section */
190+
65A456CA1754428100B5A837 /* InfoPlist.strings */ = {
191+
isa = PBXVariantGroup;
192+
children = (
193+
65A456CB1754428100B5A837 /* en */,
194+
);
195+
name = InfoPlist.strings;
196+
sourceTree = "<group>";
197+
};
198+
65A456D91754428100B5A837 /* MainStoryboard.storyboard */ = {
199+
isa = PBXVariantGroup;
200+
children = (
201+
65A456DA1754428100B5A837 /* en */,
202+
);
203+
name = MainStoryboard.storyboard;
204+
sourceTree = "<group>";
205+
};
206+
/* End PBXVariantGroup section */
207+
208+
/* Begin XCBuildConfiguration section */
209+
65A456DF1754428100B5A837 /* Debug */ = {
210+
isa = XCBuildConfiguration;
211+
buildSettings = {
212+
ALWAYS_SEARCH_USER_PATHS = NO;
213+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
214+
CLANG_CXX_LIBRARY = "libc++";
215+
CLANG_ENABLE_OBJC_ARC = YES;
216+
CLANG_WARN_CONSTANT_CONVERSION = YES;
217+
CLANG_WARN_EMPTY_BODY = YES;
218+
CLANG_WARN_ENUM_CONVERSION = YES;
219+
CLANG_WARN_INT_CONVERSION = YES;
220+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
221+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
222+
COPY_PHASE_STRIP = NO;
223+
GCC_C_LANGUAGE_STANDARD = gnu99;
224+
GCC_DYNAMIC_NO_PIC = NO;
225+
GCC_OPTIMIZATION_LEVEL = 0;
226+
GCC_PREPROCESSOR_DEFINITIONS = (
227+
"DEBUG=1",
228+
"$(inherited)",
229+
);
230+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
231+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
232+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
233+
GCC_WARN_UNUSED_VARIABLE = YES;
234+
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
235+
ONLY_ACTIVE_ARCH = YES;
236+
SDKROOT = iphoneos;
237+
};
238+
name = Debug;
239+
};
240+
65A456E01754428100B5A837 /* Release */ = {
241+
isa = XCBuildConfiguration;
242+
buildSettings = {
243+
ALWAYS_SEARCH_USER_PATHS = NO;
244+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
245+
CLANG_CXX_LIBRARY = "libc++";
246+
CLANG_ENABLE_OBJC_ARC = YES;
247+
CLANG_WARN_CONSTANT_CONVERSION = YES;
248+
CLANG_WARN_EMPTY_BODY = YES;
249+
CLANG_WARN_ENUM_CONVERSION = YES;
250+
CLANG_WARN_INT_CONVERSION = YES;
251+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
252+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
253+
COPY_PHASE_STRIP = YES;
254+
GCC_C_LANGUAGE_STANDARD = gnu99;
255+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
256+
GCC_WARN_UNINITIALIZED_AUTOS = YES;
257+
GCC_WARN_UNUSED_VARIABLE = YES;
258+
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
259+
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
260+
SDKROOT = iphoneos;
261+
VALIDATE_PRODUCT = YES;
262+
};
263+
name = Release;
264+
};
265+
65A456E21754428100B5A837 /* Debug */ = {
266+
isa = XCBuildConfiguration;
267+
buildSettings = {
268+
GCC_PRECOMPILE_PREFIX_HEADER = YES;
269+
GCC_PREFIX_HEADER = "NativeJsWebView/NativeJsWebView-Prefix.pch";
270+
INFOPLIST_FILE = "NativeJsWebView/NativeJsWebView-Info.plist";
271+
PRODUCT_NAME = "$(TARGET_NAME)";
272+
WRAPPER_EXTENSION = app;
273+
};
274+
name = Debug;
275+
};
276+
65A456E31754428100B5A837 /* Release */ = {
277+
isa = XCBuildConfiguration;
278+
buildSettings = {
279+
GCC_PRECOMPILE_PREFIX_HEADER = YES;
280+
GCC_PREFIX_HEADER = "NativeJsWebView/NativeJsWebView-Prefix.pch";
281+
INFOPLIST_FILE = "NativeJsWebView/NativeJsWebView-Info.plist";
282+
PRODUCT_NAME = "$(TARGET_NAME)";
283+
WRAPPER_EXTENSION = app;
284+
};
285+
name = Release;
286+
};
287+
/* End XCBuildConfiguration section */
288+
289+
/* Begin XCConfigurationList section */
290+
65A456B91754428100B5A837 /* Build configuration list for PBXProject "NativeJsWebView" */ = {
291+
isa = XCConfigurationList;
292+
buildConfigurations = (
293+
65A456DF1754428100B5A837 /* Debug */,
294+
65A456E01754428100B5A837 /* Release */,
295+
);
296+
defaultConfigurationIsVisible = 0;
297+
defaultConfigurationName = Release;
298+
};
299+
65A456E11754428100B5A837 /* Build configuration list for PBXNativeTarget "NativeJsWebView" */ = {
300+
isa = XCConfigurationList;
301+
buildConfigurations = (
302+
65A456E21754428100B5A837 /* Debug */,
303+
65A456E31754428100B5A837 /* Release */,
304+
);
305+
defaultConfigurationIsVisible = 0;
306+
};
307+
/* End XCConfigurationList section */
308+
};
309+
rootObject = 65A456B61754428100B5A837 /* Project object */;
310+
}

OC与JS相互调用经典实例/NativeJsWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)