質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
Objective-C

Objective-Cはオブジェクト指向型のプログラミング言語のひとつです。C言語をベースにSmalltalkが取り入れられています。

Google Analytics

Google AnalyticsはGoogleが開発した無料のウェブ分析のソリューションです。複数のクライアント側のAPIとデータをエクスポートし管理するREST APIも格納されています。

Xcode 4

Xcode 4はMac OS Xを使ってMac OSとiOSをターゲットとしたソフトウェアを開発するための主な開発ツールです。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Q&A

解決済

1回答

5157閲覧

linker command failed with exit code 1 (use -v to see invocation)のエラーについて

hirahira10

総合スコア50

Objective-C

Objective-Cはオブジェクト指向型のプログラミング言語のひとつです。C言語をベースにSmalltalkが取り入れられています。

Google Analytics

Google AnalyticsはGoogleが開発した無料のウェブ分析のソリューションです。複数のクライアント側のAPIとデータをエクスポートし管理するREST APIも格納されています。

Xcode 4

Xcode 4はMac OS Xを使ってMac OSとiOSをターゲットとしたソフトウェアを開発するための主な開発ツールです。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

0グッド

0クリップ

投稿2015/05/01 01:30

編集2015/05/01 02:14

以前こちらでxcodeのエラーについて質問させて頂いたものです。
https://teratail.com/questions/9156

以前のエラーは解消されたのですがまた別の
linker command failed with exit code 1 (use -v to see invocation)
というエラーがでてしまいました。

調べてみると
①必要なframeworkがない
②誤って同じ名前のクラス名の物を違うh.ファイル名でコンパイルしたとき

と二つの可能性があるようでした
①についてはしっかりframeworkはxcode上で揃っているのを確認し、念のためBuild SettingsのLibrary Search Pathsにあるひとつのディレクトリ内にもframeworkをxcode上からコピーしていれてみましたが変わりませんでした。

②については
ページごとに名前を設定するself.screenName部分がクラスになるのでしょうか?
もしこれだとしてもまだテストで1ファイルにしかこのコードをいれていないので重複はしていないので困っています

自分で関係があるのではないかと思う部分の詳細なコードを記載させていただきます。

AppDelegate.m

#import "AppDelegate.h"
#import "GAI.h"

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.

    //insert value for variables
    tabIndexCurrent = 1 ; //the first tab of tabbar
    tabIndexBefore = -1 ;
    contest_type = 0; // none contest
    contest_id = @""; // none contest
    catID_flag = false; //tap on button catagories in tab My Page (true: tapped - false: not be tapped)
    catID = @"";
    catName = @"";
    strDeviceToken = @""; //none device token
    JxI = @"";
    JxUIX = @"";
    path = @""; //path for copy file configInfo.plist to Document folder
    isUpdate = @"NO"; //NO = has not been updated yet
    numberOfNotifications = @"0";
    isFirstRunContestTab = @"";
    _isFirstRunApp = @"";
    strURLTemp = tabContest;
    isPostingContest = false;
    isLeavedTab = false;
    imageName = @"icon_dissableCrow.png";
    isExistiOSTwitterAccount = false; //True: user already logined on system iOS twitter;
    screenNameTwitter = @"";
    twitter_enable = @"";
    twitter_text = @"";
    pushNotification_alert = @"";

    //Connect to GrowthPush Notification
    [EasyGrowthPush setApplicationId:2922 secret:@"QJrUUHQGHtDx9LpKcHiouPtEY4dRVIHg" environment:kGrowthPushEnvironment debug:YES];
    // Optional: automatically send uncaught exceptions to Google Analytics.
    [GAI sharedInstance].trackUncaughtExceptions = YES;

    // Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
    [GAI sharedInstance].dispatchInterval = 20;

    // Optional: set Logger to VERBOSE for debug information.
    [[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];

    // Initialize tracker. Replace with your tracking ID.
    [[GAI sharedInstance] trackerWithTrackingId:@"トラッキングコード"];

    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];

    // Check to see if this is an iOS 8 device.
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
    {
    // Register for push in iOS 8.
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
    }
    else
    {
    // Register for push in iOS 7 and under.
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
    }

    //Check version for HTML Source
    [self copyPlist];

    configInfoDict = [NSMutableDictionary dictionaryWithContentsOfFile:path];

    NSLog(@"configInfoDict: %@", configInfoDict);

    JxI = [configInfoDict objectForKey:@"JxI"];
    JxUIX = [configInfoDict objectForKey:@"JxUIX"];
    isUpdate = [configInfoDict objectForKey:@"isUpdate"];
    _currentVersionHTMLFromFile = [configInfoDict objectForKey:@"Version"];
    isFirstRunContestTab = [configInfoDict objectForKey:@"isFirstRunContestTab"];
    _isFirstRunApp = [configInfoDict objectForKey:@"isFirstRunApp"];

    //Create a fake UDID for device
    NSString *domain = @"www.aaatest.com";
    NSString *key = @"auaatest";
    secrect_udid = [SecureUDID UDIDForDomain:domain usingKey:key];

    //Get number of notifications
    [self.implementAPIBussiness getNumberOfNotificationsWithJxI:JxI];

    //update SecureUDID for server numbers of download aaa app
    if ([_isFirstRunApp isEqualToString:@"NO"])
    {
    [self newDownload:secrect_udid];

    [configInfoDict setValue:@"YES" forKey:@"isFirstRunApp"]; _isFirstRunApp = @"YES"; if ([configInfoDict writeToFile:path atomically:YES]) { NSLog(@"Edit file plist successfull"); }

    }

    //Get version HTML from server
    [self.implementAPIBussiness checkVersionHTML];

    [self performSelector:@selector(loadScreen) withObject:nil afterDelay:1.0];

    return YES;

}

TimelineViewController.h
#import "GAITrackedViewController.h"

@interface TimelineViewController : GAITrackedViewController <UIWebViewDelegate, UISearchBarDelegate, UIAlertViewDelegate, UIScrollViewDelegate, EGORefreshTableHeaderDelegate>

{
AppDelegate *mainDelegate;

EGORefreshTableHeaderView *_refreshHeaderView; UIScrollView *webScroller; BOOL _reloading;

}

TimelineViewController.m

#import "GAITrackedViewController.h"
@interface TimelineViewController (){
CGRect originalFrame;
}

@end

@implementation TimelineViewController
-(void)viewWillAppear:(BOOL)animated
{
_webView.delegate = self;

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveNotification:) name:@"numberNotification" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveNotification:) name:@"tapTabTimelineAgain" object:nil]; [super viewWillAppear:animated];

self.screenName = [NSString stringWithFormat:@"%@", NSStringFromClass([self class])];
self.screenName = @"timeline";

}

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

こんにちは。

クラス名の重複使用や importするファイルのまちがいがないとすると、
重点的に点検するべきところは frameworkということになりそうです。

必要な frameworkについては、すべてそろっていることを確認していただいているようですが、
ライブラリ内(Link Binary With Libraries)での順番はいかがでしょうか。

Google アナリティクス関連の frameworkの順番は

lang

1CoreData.framework 2SystemConfiguration.framework 3libz.dylib 4libGoogleAnalyticsServices.a

となっていますでしょうか。
frameworkの読み込みは、上段から順番に行われるため、いちばん上に libGoogleAnalyticsServices.aがある場合、リンカエラーを起こすことがあるようです。
ですので、(現状、ここに問題がなかったとしても)上記の順番に並び替えることをおすすめします。

あと、ソースコードの最後の行

lang

1self.screenName = @"timeline";

は不要なのでは……

以上、ご参考いただければ幸いです。

投稿2015/05/01 02:13

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hirahira10

2015/05/01 02:19

GeorgeCohtasさん いつもありがとうございます。 frameworkの順番変更とself.screenName = @"timeline";を削除させていただきました! おかげさまで まだ計測は取れていないのですがエラーはなくすことができました! 本当にありがとうございました! また別の部分で計測がとれていない原因などもご質問させて頂けると幸いです
退会済みユーザー

退会済みユーザー

2015/05/01 02:26

この件は、解消されたということで、なによりです。 計測できない原因は、いったいなんなのでしょうか。 時間の問題であれば、いいのですが……
hirahira10

2015/05/01 02:41

GeorgeCohtaさん エラーなどがでているわけではないのでなかなか自分でもどこから 調べたらいいのかわからなくなってしまっています。 iOS シミュレーターでは計測されないなどもあるのかなと考えております
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問