aboutsummaryrefslogtreecommitdiffhomepage
path: root/example
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-05-04 16:12:07 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-05-04 16:46:41 -0700
commit729667252cd632357a3277ce1ef3220e5d61caf5 (patch)
tree6bf16f2122efcc7d9d260bc992bb96fc7d679e89 /example
parent4f3dd27b20c155767100a0395553ad068135d750 (diff)
use NSAutoreleasePool on Mac/iOS to implement MCAutoreleasePool
Diffstat (limited to 'example')
-rw-r--r--example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj6
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/Application.h13
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/Application.mm20
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/main.mm5
-rw-r--r--example/mac/macExample/macExample.xcodeproj/project.pbxproj6
-rw-r--r--example/mac/macExample/macExample/MCTApplication.h13
-rw-r--r--example/mac/macExample/macExample/MCTApplication.mm22
-rw-r--r--example/mac/macExample/macExample/macExample-Info.plist2
-rw-r--r--example/mac/macExample/macExample/main.mm4
9 files changed, 4 insertions, 87 deletions
diff --git a/example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj b/example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj
index cc5a6ae7..bf9f8cbb 100644
--- a/example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj
+++ b/example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj
@@ -10,7 +10,6 @@
AB665BCD17134336007F2151 /* FXKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = AB665BCB17134336007F2151 /* FXKeychain.m */; };
AB7BA446171389CC00104953 /* libMailCore-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7BA43D1713898B00104953 /* libMailCore-ios.a */; };
AB7BA4481713913F00104953 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7BA4471713913F00104953 /* CFNetwork.framework */; };
- AB7BA4511713CE3300104953 /* Application.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB7BA4501713CE3300104953 /* Application.mm */; };
AB9EAE06170368F000D750C7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB9EAE05170368F000D750C7 /* UIKit.framework */; };
AB9EAE08170368F000D750C7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB9EAE07170368F000D750C7 /* Foundation.framework */; };
AB9EAE0A170368F000D750C7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB9EAE09170368F000D750C7 /* CoreGraphics.framework */; };
@@ -81,8 +80,6 @@
AB665BCC17134336007F2151 /* FXKeychain_LICENCE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FXKeychain_LICENCE.md; sourceTree = "<group>"; };
AB7BA4321713898B00104953 /* mailcore2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mailcore2.xcodeproj; path = "../../../../build-mac/mailcore2.xcodeproj"; sourceTree = "<group>"; };
AB7BA4471713913F00104953 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
- AB7BA44F1713CE3300104953 /* Application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Application.h; sourceTree = "<group>"; };
- AB7BA4501713CE3300104953 /* Application.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Application.mm; sourceTree = "<group>"; };
AB9EAE02170368F000D750C7 /* iOS UI Test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS UI Test.app"; sourceTree = BUILT_PRODUCTS_DIR; };
AB9EAE05170368F000D750C7 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
AB9EAE07170368F000D750C7 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -185,8 +182,6 @@
children = (
AB7BA4321713898B00104953 /* mailcore2.xcodeproj */,
AB9EAE11170368F000D750C7 /* main.mm */,
- AB7BA44F1713CE3300104953 /* Application.h */,
- AB7BA4501713CE3300104953 /* Application.mm */,
AB9EAE14170368F000D750C7 /* AppDelegate.h */,
AB9EAE15170368F000D750C7 /* AppDelegate.m */,
AB9EAE1D170368F000D750C7 /* MainStoryboard.storyboard */,
@@ -337,7 +332,6 @@
AB9EAE22170368F000D750C7 /* MasterViewController.m in Sources */,
AB9EAE3617036FD700D750C7 /* SettingsViewController.m in Sources */,
AB665BCD17134336007F2151 /* FXKeychain.m in Sources */,
- AB7BA4511713CE3300104953 /* Application.mm in Sources */,
B12AAA3317322654003551C7 /* MCOCIDURLProtocol.mm in Sources */,
B12AAA3417322654003551C7 /* MCOMessageView.mm in Sources */,
B12AAA3517322654003551C7 /* MCTMsgViewController.m in Sources */,
diff --git a/example/ios/iOS UI Test/iOS UI Test/Application.h b/example/ios/iOS UI Test/iOS UI Test/Application.h
deleted file mode 100644
index a0c525a6..00000000
--- a/example/ios/iOS UI Test/iOS UI Test/Application.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// Application.h
-// iOS UI Test
-//
-// Created by Jonathan Willing on 4/8/13.
-// Copyright (c) 2013 AppJon. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface Application : UIApplication
-
-@end
diff --git a/example/ios/iOS UI Test/iOS UI Test/Application.mm b/example/ios/iOS UI Test/iOS UI Test/Application.mm
deleted file mode 100644
index 48185d5b..00000000
--- a/example/ios/iOS UI Test/iOS UI Test/Application.mm
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// Application.mm
-// iOS UI Test
-//
-// Created by Jonathan Willing on 4/8/13.
-// Copyright (c) 2013 AppJon. All rights reserved.
-//
-
-#import "Application.h"
-#import <MailCore/MailCore.h>
-
-@implementation Application
-
-- (void)sendEvent:(UIEvent *)event {
- mailcore::AutoreleasePool *pool = new mailcore::AutoreleasePool();
- [super sendEvent:event];
- pool->release();
-}
-
-@end
diff --git a/example/ios/iOS UI Test/iOS UI Test/main.mm b/example/ios/iOS UI Test/iOS UI Test/main.mm
index 34793ec3..c9092479 100644
--- a/example/ios/iOS UI Test/iOS UI Test/main.mm
+++ b/example/ios/iOS UI Test/iOS UI Test/main.mm
@@ -9,12 +9,9 @@
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
-#import "Application.h"
#import <MailCore/MailCore.h>
int main(int argc, char *argv[]) {
mailcore::logEnabled = false;
- mailcore::AutoreleasePool *pool = new mailcore::AutoreleasePool();
- return UIApplicationMain(argc, argv, NSStringFromClass([Application class]), NSStringFromClass([AppDelegate class]));
- pool->release();
+ return UIApplicationMain(argc, argv, nil, @"AppDelegate");
}
diff --git a/example/mac/macExample/macExample.xcodeproj/project.pbxproj b/example/mac/macExample/macExample.xcodeproj/project.pbxproj
index e0c08c51..3513d61e 100644
--- a/example/mac/macExample/macExample.xcodeproj/project.pbxproj
+++ b/example/mac/macExample/macExample.xcodeproj/project.pbxproj
@@ -11,7 +11,6 @@
C6BD2873170BC5C500A91AC1 /* MCOCIDURLProtocol.mm in Sources */ = {isa = PBXBuildFile; fileRef = C6BD2870170BC5C500A91AC1 /* MCOCIDURLProtocol.mm */; };
C6BD2874170BC5C500A91AC1 /* MCOMessageView.mm in Sources */ = {isa = PBXBuildFile; fileRef = C6BD2872170BC5C500A91AC1 /* MCOMessageView.mm */; };
C6BD28B4170BDFE500A91AC1 /* MailCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6BD28B3170BDFE500A91AC1 /* MailCore.framework */; };
- C6BD28BA170C14C300A91AC1 /* MCTApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = C6BD28B9170C14C300A91AC1 /* MCTApplication.mm */; };
C6D42BB616ABB39A002BB4F9 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6D42BB516ABB39A002BB4F9 /* Cocoa.framework */; };
C6D42BC916ABB39A002BB4F9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C6D42BC816ABB39A002BB4F9 /* AppDelegate.m */; };
C6D42BCC16ABB39A002BB4F9 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C6D42BCA16ABB39A002BB4F9 /* MainMenu.xib */; };
@@ -72,8 +71,6 @@
C6BD2871170BC5C500A91AC1 /* MCOMessageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCOMessageView.h; sourceTree = "<group>"; };
C6BD2872170BC5C500A91AC1 /* MCOMessageView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MCOMessageView.mm; sourceTree = "<group>"; };
C6BD2877170BC8ED00A91AC1 /* mailcore2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mailcore2.xcodeproj; path = "../../../build-mac/mailcore2.xcodeproj"; sourceTree = "<group>"; };
- C6BD28B8170C14C300A91AC1 /* MCTApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCTApplication.h; sourceTree = "<group>"; };
- C6BD28B9170C14C300A91AC1 /* MCTApplication.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MCTApplication.mm; sourceTree = "<group>"; };
C6D42BB116ABB39A002BB4F9 /* macExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = macExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
C6D42BB516ABB39A002BB4F9 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
C6D42BB816ABB39A002BB4F9 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -202,8 +199,6 @@
C6D42BE816ACF711002BB4F9 /* MCTMsgListViewController.m */,
C6D42BEA16ACFE3F002BB4F9 /* MCTMsgViewController.h */,
C6D42BEB16ACFE3F002BB4F9 /* MCTMsgViewController.m */,
- C6BD28B8170C14C300A91AC1 /* MCTApplication.h */,
- C6BD28B9170C14C300A91AC1 /* MCTApplication.mm */,
);
path = macExample;
sourceTree = "<group>";
@@ -330,7 +325,6 @@
C64FF38416AF97F400F8C162 /* main.mm in Sources */,
C6BD2873170BC5C500A91AC1 /* MCOCIDURLProtocol.mm in Sources */,
C6BD2874170BC5C500A91AC1 /* MCOMessageView.mm in Sources */,
- C6BD28BA170C14C300A91AC1 /* MCTApplication.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/example/mac/macExample/macExample/MCTApplication.h b/example/mac/macExample/macExample/MCTApplication.h
deleted file mode 100644
index a919bc90..00000000
--- a/example/mac/macExample/macExample/MCTApplication.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// MCTApplication.h
-// macExample
-//
-// Created by DINH Viêt Hoà on 4/3/13.
-// Copyright (c) 2013 MailCore. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
-@interface MCTApplication : NSApplication
-
-@end
diff --git a/example/mac/macExample/macExample/MCTApplication.mm b/example/mac/macExample/macExample/MCTApplication.mm
deleted file mode 100644
index f2c4c597..00000000
--- a/example/mac/macExample/macExample/MCTApplication.mm
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// MCTApplication.m
-// macExample
-//
-// Created by DINH Viêt Hoà on 4/3/13.
-// Copyright (c) 2013 MailCore. All rights reserved.
-//
-
-#import "MCTApplication.h"
-
-#import <mailcore/mailcore.h>
-
-@implementation MCTApplication
-
-- (void) sendEvent:(NSEvent *)theEvent
-{
- mailcore::AutoreleasePool * pool = new mailcore::AutoreleasePool();
- [super sendEvent:theEvent];
- pool->release();
-}
-
-@end
diff --git a/example/mac/macExample/macExample/macExample-Info.plist b/example/mac/macExample/macExample/macExample-Info.plist
index cfc74c76..39e003f6 100644
--- a/example/mac/macExample/macExample/macExample-Info.plist
+++ b/example/mac/macExample/macExample/macExample-Info.plist
@@ -29,6 +29,6 @@
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
- <string>MCTApplication</string>
+ <string>NSApplication</string>
</dict>
</plist>
diff --git a/example/mac/macExample/macExample/main.mm b/example/mac/macExample/macExample/main.mm
index 9572234a..cdb19817 100644
--- a/example/mac/macExample/macExample/main.mm
+++ b/example/mac/macExample/macExample/main.mm
@@ -13,7 +13,7 @@
int main(int argc, char *argv[])
{
u_setDataDirectory("/usr/local/share/icu");
- mailcore::AutoreleasePool * pool = new mailcore::AutoreleasePool();
+ //mailcore::AutoreleasePool * pool = new mailcore::AutoreleasePool();
return NSApplicationMain(argc, (const char **)argv);
- pool->release();
+ //pool->release();
}