Giter Club home page Giter Club logo

Comments (5)

Dejal avatar Dejal commented on August 15, 2024

The semicolon after the method name makes it easier to copy the line to the header file. The semicolon is optional, and is ignored. It isn’t dead code.

from dejalactivityview.

AEDWIP avatar AEDWIP commented on August 15, 2024

Hi Dejal

You have two functions with exact same signature. I suspect the compiler / linker only sees one. In my case I know the last one is executed. It is not clear when the first one would be executed.

You might consider implementing using a more modern style based on categories
https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/Category.html

One advantage of this style is the compiler will generated an "error: duplicate declaration of method" error.

//
//  SpotifyAuthController.m
// 

#import "CacheHelper.h"
#import "SCIMediaItem.h"

@interface CacheHelper(Private)
+ (void) copySampleSong:(FileInfoData *)audioFileData 
                FromAppBundleWithDelegate:(NSObject<CacheHelperDelegate> *)delegate 
                withCallbackData:(void *)callbackData ;

- (void) play;

@property (nonatomic, strong) ImportSpotifyCoreAudioController *iscac;

@end


@implementation CacheHelper

@synthesize iscac;

///////////////////////////////////////////////////////////////////////////////
+ (void) copySampleSong:(FileInfoData *)audioFileData 
        FromAppBundleWithDelegate:(NSObject<CacheHelperDelegate> *)delegate 
        withCallbackData:(void *)callbackData {

 ...

}

- (void) play {

  ...

}

@end

from dejalactivityview.

Dejal avatar Dejal commented on August 15, 2024

The first is in a local header for private methods. Did you not notice the @interface? This used to be required to be able to call them, though nowadays the compiler can find methods within the same file without it.

from dejalactivityview.

AEDWIP avatar AEDWIP commented on August 15, 2024

Hi Dejal

I really like your work. You have two functions with the same signature. I is not clear which version will be use when. I am just trying to encourage you to make your code more valuable by making it easier to understand and maintain. You know https://en.wikipedia.org/wiki/Occam%27s_razor. Try and keep things simple whenever possible

Kind Regards

Andy

from dejalactivityview.

drallgood avatar drallgood commented on August 15, 2024

@AEDWIP I think you didn't read that file carefully enough. There are multiple classes in the same file, hence the duplicate methods.
I agree, though, that this is bad style and should be split into separate files.

from dejalactivityview.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.