Search Results

Search found 2047 results on 82 pages for 'joined subclass'.

Page 19/82 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • iPad: SplitView does not rotate

    - by raj.tiwari
    I have the following setup: A subclass of UISplitViewController that creates the master and detail view controllers in the constructor. Master and Detail view controllers that both override shouldAutorotateToInterfaceOrientation to return `YES'. Detail view controller implements the UISplitViewControllerDelegate protocol and deals with the popover. I am observing two weird issues that might be interrelated: When the split view comes up (in portrait mode - default on simulator), the Master view is visible. It should not be. When I rotate the simulator, the view does not "right" itself. My UISplitViewController subclass does not override shouldAutorotateToInterfaceOrientation. However, both master and details view controllers do and return YES. Any ideas what I might be doing wrong? Is this a simulator bug? Thanks. -Raj

    Read the article

  • Tableview reload data problem iphone sdk

    - by neha
    Hi all, I have a class A which is a subclass of uitableviewcontroller and one more class B which actually displays my tableview with its content is a subclass of A. There's an xml parser which parses my xml and stores the content in an nsmutablearray of application delegate. Now, I fetch this delegate array into a local nsmutablearray in class B to minimise the communication between the two classes i.e. delegate and class B and display that. After certain condition is met in class A, I'm calling xml parser to refill the delegate array and I'm calling class B's tableview reload method. The problem is when I call the tableview's reload data, class B's delegate methods are called. But before that I need to grab this delegate array in local array in class B. How shall I do that? Can anybody please help? Thanx in advance.

    Read the article

  • How do I join these queries?

    - by GregoryD
    query1: SELECT category.id, category.name, category.level, category.description, category.cat1, category.cat2, category.cat3, category.cat4, category.pri_color, category.sec_color, category.last_report AS report_id FROM category, reports_category_layout WHERE category.id = reports_category_layout.catID AND reports_category_layout.site_code = 'las' query2: SELECT DISTINCT category.id, COUNT(forum.id) AS posts, SUM(forum.view) AS views FROM category, forum WHERE category.id = forum.catID AND forum.approved = 'yes' AND forum.site_code = 'las' GROUP BY category.id query3: SELECT forum.catID, forum.title, forum.paragraph, forum.created, users.alias, forum.userID FROM forum, users, forum_cache WHERE forum.catID = forum_cache.catID AND forum.id = forum_cache.last_report AND users.id = forum.userID AND forum.approved = 'yes' Essentially, I am unsure about the syntax to join these properly. I have written a query that simply joins them, but in the case that the forum cache table contains an unapproved forum id, it will simply not return the entire row. what I really need is for query1 and query2 to be left joined on the category id, and for query 3 to be left outer joined on id = catID.

    Read the article

  • UITableView in a View controller by a UIViewController and not a UITableView

    - by dirrigc
    Hi all, I have a View with lots of things inside it including buttons, a scroll view and a tableView (ipad app). I am controller this view with a viewController subclass but I don't know how to manage my tableView. I don't know where put the methods : - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath should i add them to my ViewController or should i create a new subclass of UITableViewController (and get them "for free") and set the dataSource and delegate of my tableView to that class when I create it programmatically? I am storing the data I want to show in my appDelegate following the tutorial : http://www.iphonesdkarticles.com/2008/10/sqlite-tutorial-selecting-data.html I am new at developing and I fear I am spagetti coding. Thanks a lot

    Read the article

  • Must I call super when I implement -scrollViewDidScroll: of UIScrollViewDelegate in an UITableView?

    - by mystify
    I made a custom UITableView subclass and implemented this: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { // scrolled... } Now, what I think is that UITableView may also love to get this message for some obvious reasons. However, when I don't forward that to super, for some reason, everything still works fine. Must I forward that guy to super? I mean...it's a delegate method implementation, but as far as I'm aware of, this would still override anything implemented in UITableView, or not? Edit: I see...the delegate could be anyone. Never mind about this. BUT: What I have such a thing in a superclass, and make a subclass. How would I even know that the superclass does implement that method and I must forward it to super?

    Read the article

  • Catching OutOfMemoryError

    - by dotsid
    Documentation for java.lang.Error says: An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch But as java.lang.Error is subclass of java.lang.Throwable I can catch this type of throwable. I understand why this is not good idea to catch this sort of exceptions. As far as I understand, if we decide to caught it, the catch handler should not allocate any memory by itself. Otherwise OutOfMemoryError will be thrown again. So, my question is: is there any real word scenarios when catching java.lang.OutOfMemoryError may be a good idea? if we catching java.lang.OutOfMemoryError how can we sure that catch handler doesn't allocate any memory by itself (any tools or best practicies)? Thanks a lot.

    Read the article

  • How can I locate the indexpath of the UITableviewCell a certain button is in when I click that butto

    - by Jake
    I've added a button as an accessory view to uitableviewcell, and I when I press it, I'd like to be able to access the index path of the table view cell it's currently inside of so I can delete/modify the contents of that cell. Should I subclass UIbutton and add make it have it's own index path property? If so, do I need to implement any specific button methods in that subclass of will they automatically be loaded? Any help would be greatly appreciated. Sorry if this is a noobie question.

    Read the article

  • Hibernate MappingException

    - by Marcus
    I'm getting this Hibernate error: org.hibernate.MappingException: Could not determine type for: a.b.c.Results$BusinessDate, for columns: [org.hibernate.mapping.Column(businessDate)] The class is below. Does anyone know why I'm getting this error?? @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "businessDate" }) @XmlRootElement(name = "Results") @Entity(name = "Results") @Table(name = "RESULT") @Inheritance(strategy = InheritanceType.JOINED) @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) public class Results implements Equals, HashCode { @XmlElement(name = "BusinessDate", required = true) protected Results.BusinessDate businessDate; public Results.BusinessDate getBusinessDate() { return businessDate; } public void setBusinessDate(Results.BusinessDate value) { this.businessDate = value; } @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "raw", "display" }) @Entity(name = "Results$BusinessDate") @Table(name = "BUSINESSDATE") @Inheritance(strategy = InheritanceType.JOINED) public static class BusinessDate implements Equals, HashCode { ....

    Read the article

  • Using PyQt signals correctly

    - by Skilldrick
    A while ago I did some work in Qt for C++; now I'm working with PyQt. I have a subclass of QStackedWidget, and inside that a subclass of QWidget. In the QWidget I want to click a button that goes to the next page of the QStackedWidget. My (simplified) approach is as follows: class Stacked(QtGui.QStackedWidget): def __init__(self, parent=None): QtGui.QStackedWidget.__init__(self, parent) self.widget1 = EventsPage() self.widget1.nextPage.connect(self.nextPage) self.widget2 = MyWidget() self.addWidget(self.widget1) self.addWidget(self.widget2) def nextPage(self): self.setCurrentIndex(self.currentIndex() + 1) class EventsPage(QtGui.QWidget): nextPage = QtCore.pyqtSignal() def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.continueButton = QtGui.QPushButton('Continue') self.continueButton.clicked.connect(self.nextPage) So, basically, I'm connecting the continueButton clicked signal to the EventsPage nextPage signal, which I'm then connecting in Stacked to the nextPage method. I could just delve into the internals of EventsPage in Stacked and connect self.widget1.continueButton.clicked, but that seemed to completely defeat the purpose of signals and slots. So does this approach make sense, or is there a better way?

    Read the article

  • UISplitViewCOntroller + TabBarCOntroller + iPad

    - by tek3
    Hi all, I am developing a tab-based iPad application in which corresponding to each tab, I have to show an UISplitViewController . I have done this by adding two navigation controllers to my tabBarController and assigning a subclass of UISplitViewController as RootViewController of both navigationController. And also I have to show both viewControllers(Master and Detail) in both modes(Potrait and Landscape). For this I have constructed a subclass of UISplitViewController in which i am overriding willAnimateRotationToInterfaceOrientation method and setting the frame of both ViewControllers as demonstrated in this link. However i am not able to set both viewControllers correctly.If my app starts in Landscape mode everything displays fine but if i open it in Potrait mode then the orientation of both ViewControllers changes. Sometimes the MasterView occupies the entire screen or sometimes both ViewControllers appear leaving a black line between them and the navigationBar. I have been banging my head over this problem since two days without any success. kindly help..

    Read the article

  • Fluent | Nhibernate multiple inheritance mapping?

    - by Broken Pipe
    I'm trying to map this classes: public interface IBusinessObject { Guid Id { get; set; } } public class Product { public virtual Guid Id { get; set; } public virtual int ProductTypeId { get; set; } } public class ProductWeSell : Product, IBusinessObject { } public class ProductWeDontSell : Product { } Using this Fluent mapping code: public class IBusinessObjectMap : ClassMap<IBusinessObject> { public IBusinessObjectMap() { Id(t => t.Id).GeneratedBy.Guid(); Table("BusinessObject"); } } public class ProductMap : ClassMap<Product> { public ProductMap() { Id(t => t.Id); DiscriminateSubClassesOnColumn("ProductTypeId", "null").Nullable(); } } public class ProductWeSellMap : SubclassMap<ProductWeSell> { public ProductWeSellMap() { DiscriminatorValue(1); KeyColumn("Id"); } } public class ProductWeDontSellMap : SubclassMap<ProductWeDontSell> { public ProductWeDontSellMap() { DiscriminatorValue(2); KeyColumn("Id"); } } But I get {"Duplicate class/entity mapping ProductWeSell"} error. And if we take a look at generated HBM, indeed it's duplicated, but i have no idea how to write this mapping without duplicating it if it's possible at all. Produced hbm: <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class xmlns="urn:nhibernate-mapping-2.2" name="IBusinessObject" table="BusinessObject"> <joined-subclass name="ProductWeSell" table="ProductWeSell"/> </class> </hibernate-mapping> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class xmlns="urn:nhibernate-mapping-2.2" discriminator-value="null" name="Product" table="Product"> <discriminator type="String"> <column name="ProductTypeId" not-null="false" /> </discriminator> <subclass name="ProductWeDontSell" discriminator-value="2" /> <subclass name="ProductWeSell" discriminator-value="1" /> </class> </hibernate-mapping> So far I was unable to figure out how to map this using fluent Nhibernate (i haven't tried mapping this using hmb files). Any help appreciated Fluent or HBM files. The thing I'm trying to solve look identical to this topic: NHibernate inheritance mapping question

    Read the article

  • How to implement UIViewController rotation in response to orientation changes?

    - by Greg Maletic
    My app has about 10 different UIViewControllers, just one of which I want to switch to landscape mode if the device is rotated. (All the rest, I want to keep in portrait.) In order to implement rotation on that one view, I needed to implement its controller's 'shouldAutorotate' method and return YES. Since this view is accessed via a navigation controller, I also needed to create a subclass of UINavigationController that implements 'shouldAutorotate' and return YES. This solution works, but too well. I find that all of the UIViewControllers I push onto my subclass of UINavigationController respond to rotation, even if I implement 'shouldAutorotate' and return NO. (Remember: I only want one particular UIViewController to respond to rotation, not every one in the navigation controller's stack.) So, my question is: how do I best do this? All the solutions I can come up with seem 1) cumbersome, and 2) worse, don't seem to work. Thanks very much.

    Read the article

  • Why can't I declare C# methods virtual and static?

    - by Luke
    I have a helper class that is just a bunch of static methods and would like to subclass the helper class. Some behavior is unique depending on the subclass so I would like to call a virtual method from the base class, but since all the methods are static I can't create a plain virtual method (need object reference in order to access virtual method). Is there any way around this? I guess I could use a singleton.. HelperClass.Instance.HelperMethod() isn't so much worse than HelperClass.HelperMethod(). Brownie points for anyone that can point out some languages that support virtual static methods. Edit: OK yeah I'm crazy. Google search results had me thinking I wasn't for a bit there.

    Read the article

  • Catching java.lang.OutOfMemoryError

    - by dotsid
    Documentation for java.lang.Error says: An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch But as java.lang.Error is subclass of java.lang.Throwable I can catch this type of throwable. I understand why this is not good idea to catch this sort of exceptions. As far as I understand, if we decide to caught it, the catch handler should not allocate any memory by itself. Otherwise OutOfMemoryError will be thrown again. So, my question is: is there any real word scenarios when catching java.lang.OutOfMemoryError may be a good idea? if we catching java.lang.OutOfMemoryError how can we sure that catch handler doesn't allocate any memory by itself (any tools or best practicies)? Thanks a lot.

    Read the article

  • Is it possible to get an NSView to pass rightMouseDown: to the next responder without subclassing?

    - by Benedict Cohen
    I have a view which contains a few subviews: mainView subViewA subViewB SubViewC mainView is an NSView constructed from a nib and is controlled with an NSViewController subclass. The subviews are standard views such as NSTextField and NSImageView and are configured to be non-editable. I want mainView to receive rightMouseDown: even when the event is triggered in one of the subviews. The default implementation of rightMouseDown: in NSResponder passes the event to the next responder, but NSView changes the default behaviour and does not pass it to the next responder. I could subclass all of the subviews but this doesn't seem like a very elegant or maintainable solution. How can I get the subviews to pass rightMouseDown: messages to the next responder without subclassing all of the subviews?

    Read the article

  • Is this a situation where Qt Model/View architecture is not useful?

    - by csmithmaui
    Hi, I am writing a GUI based application where I read a string of values from serial port every few seconds and I need to display most of the values in some type graphical indicator(I was thinking of QprogressBar maybe) that displays the range and the value. Some of the other data that I am parsing from the string are the date and fault codes. Also, the data is hierarchical. I wanted to use the model/view architecture of Qt because I have been interested in MVC stuff for a while but have never quite wrapped my brain around how to implement it very well. As of now, I have subclassed QAbstractItemModel and in the model I read the serial port and wrap the items parsed from the string in a Tree data structure. I can view all of the data in a QtreeView with no issues. I have also began to subclass QAbstractItemView to build my custom view with all of the Graphical Indicators and such. This is where I am getting stuck. It seems to me that in order for me to design a view that knows how to display my custom model the view needs to know exactly how all of the data in the model is organized. Doesn't that defeat the purpose of Model/View? The QTreeView I tested the model with is basically just displaying the model as it is setup in the Tree structure but I don't want to do that because the data is not all of the same type. Is the type of data or the way you would like to present it to the user a determining factor in whether or not you should use this architecture? I always assumed it was just always better to design in an MVC style. It seems to me like it might have been better to just subclass QWidget and then read in from the serial port and update all of subwidgets(graphical indicators, labels, etc...) from the subclass. Essentially, do everything in one class. Does anybody understand this issue that can explain to me either what I am missing or why I shouldn't be doing it this way. As of now I am a little confused. Thanks so much for any help!

    Read the article

  • Inherit a parent class docstring as __doc__ attribute

    - by Reinout van Rees
    There is a question about Inherit docstrings in Python class inheritance, but the answers there deal with method docstrings. My question is how to inherit a docstring of a parent class as the __doc__ attribute. The usecase is that Django rest framework generates nice documentation in the html version of your API based on your view classes' docstrings. But when inheriting a base class (with a docstring) in a class without a docstring, the API doesn't show the docstring. It might very well be that sphinx and other tools do the right thing and handle the docstring inheritance for me, but django rest framework looks at the (empty) .__doc__ attribute. class ParentWithDocstring(object): """Parent docstring""" pass class SubClassWithoutDoctring(ParentWithDocstring): pass parent = ParentWithDocstring() print parent.__doc__ # Prints "Parent docstring". subclass = SubClassWithoutDoctring() print subclass.__doc__ # Prints "None" I've tried something like super(SubClassWithoutDocstring, self).__doc__, but that also only got me a None.

    Read the article

  • Issue with python string join.

    - by Pradyot
    I have some code in which I apply a join to a list. The list before the join looks like this: ["'DealerwebAgcy_NYK_GW_UAT'", "'DealerwebAgcy'", "'UAT'", '@ECNPhysicalMarketCo nfigId', "'GATEWAY'", "'DEALERWEB_MD_AGCY'", "'NU1MKVETC'", "'mkvetcu'", "'C:\te mp'", '0', "'NYK'", '0', '1', "'isqlw.exe'", 'GetDate()', '12345', "'NYK'", '350 ', '7'] After the join this is the resulting string 'DealerwebAgcy_NYK_GW_UAT','DealerwebAgcy','UAT',@ECNPhysicalMarketConfigId,'GAT EWAY','DEALERWEB_MD_AGCY','NU1MKVETC','mkvetcu','C: emp',0,'NYK',0,1,'isqlw. exe',GetDate(),12345,'NYK',350,7 Note the element "'C:\temp'" which ends up as ,'C: emp', I tried something similar on the python command prompt , but I wasn't able to 2 repeat this. the relevant code responsible for this magic is as follows. values_dict["ECNMarketInstance"] = [strVal(self.EcnInstance_),strVal (self.DisplayName_) ,strVal(self.environment_), '@ECNPhysicalMarketConfigId', strVal(self.EcnGatewaTypeId_),strVal(self.ConnectionComponent_) ,strVal(self.UserName_),strVal(self.Password_),strVal(self.WorkingDir_),"0",strVal(self.region_),"0","1", strVal(self.LUVersion_), "GetDate()" , self.LUUserId_ ,strVal(self.LUOwningSite_),self.QuoteColumnId_ , self.Capabilities_] delim = "," joined = delim.join(values) print values print joined

    Read the article

  • Why can't sub-packages see package private classes?

    - by Polaris878
    Okay so, I have this project structure: package A.B class SuperClass (this class is marked package private) package A.B.C class SubClass (inherits from super class) I'd rather not make SuperClass publicly visible... It is really just a utility class for this specific project (A.B). It seems to me that SubClass should be able to see SuperClass, because package A.B.C is a subpackage of A.B... but this is not the case. What would be the best way to resolve this issue? I don't think it makes sense to move everything in A.B.C up to A.B or move A.B down to A.B.C... mainly because there will probably be an A.B.D which inherits from stuff in A.B as well... I'm a bit new to Java, so be nice :D (I'm a C++ and .NET guy)

    Read the article

  • One entityManger finds entity , the other does not.

    - by Pitelk
    Hi all, I have a very strange behavior in my program. I have 2 classes (class LogIn and CreateGame) where i have injected an EntityManager in each using the annotation @PersistenceContext(unitName="myUnitPU") EntityManager entitymanger; In some point i remove an object called "user" from the database using entitymanger.remove(user) from a method in LogIn class. The business logic is that a user can host and join games ( in the same time) so removing the user all the entries in database about the games the user has created are removed and all the entries showing in which games the user has joined are removed also. After that, i call another function which checks if the user exists using a method in the LogIn class entitymanager.find(user) which surprisingly enough, finds the user. After that I call a method in CreateGame class which tries to find the user by using again entitymanger.find(user) the entitymanger in that class fails to find the user (which is the expected result as the user is removed and it's not in the database) So the question is : Why the entitymanager in one class finds the user (which is wrong) where the other doesn't find it? Does anyone has ever the same problem? PS : This "bug" occurs when the user has hosted a game which is joined by another user (lets call him Buser) and the Buser has made a game which is joined by the current user. GAME | HOST | CLIENTS game1 | user | userB game2 | userB | user where in this case by removing the user, the game1 is deleted and the user is removed from game2 so the result is GAME | HOST | CLIENTS game2 | userB | PS2 : The Beans are EJB3.0. The methods are called from a delegate class. The beans in the delegate class are instantiated using the InitialContext.lookup() method. Note that for logging in ,creating , joining games the appropriate delegate class calls the correspondent EJB which does the transactions. In the case of logOut, the delegate calls an EJB to logout the user but becuase other stuff must be done (as said above) this EJB calls other EJB (again using lookup() ) which has methods like removegame(), removeUserFromGame() etc. After those methods are executed the user is then logged out. Maybe it has something to do with the fact the the first entity manager is called by a delegate but the second from inside an EJb and thats why the one entitymanger can see the non-existent user while the other cannot? Also all the methods have TRANSACTIONTYPE.REQUIRED Thank you in advance

    Read the article

  • NSZombieEnabled hides EXC_BAD_ACCESS error entirely

    - by David Liu
    So I have a subclass of a UIView that starts causing EXC_BAD_ACCESS errors when I go through a specific set of conditions (run on iPad instead of iPhone or simulator, first login only). It throws the exception when the UIView subclass gets deallocated, during the last line, where I have [super dealloc]. I heard about using NSZombieEnabled, so I tossed that on to see if I could get any more information about it, but now it hides the error completely! Does anyone know a bit more about this type of situation? I thought NSZombie would start spewing stuff into my console like before, but I'm hoping that the nonexistance of errors would tell me some sort of information as well.

    Read the article

  • Running out of memory with UIImage creation on an offscreen Bitmap Context by NSOperation

    - by sigsegv
    I have an app with multiple UIView subclasses that acts as pages for a UIScrollView. UIViews are moved back and forth to provide a seamless experience to the user. Since the content of the views is rather slow to draw, it's rendered on a single shared CGBitmapContext guarded by locks by NSOperation subclasses - executed one at once in an NSOperationQueue - wrapped up in an UIImage and then used by the main thread to update the content of the views. -(void)main { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc]init]; if([self isCancelled]) { return; } if(nil == data) { return; } // Buffer is the shared instance of a CG Bitmap Context wrapper class // data is a dictionary CGImageRef img = [buffer imageCreateWithData:data]; UIImage * image = [[UIImage alloc]initWithCGImage:img]; CGImageRelease(img); if([self isCancelled]) { [image release]; return; } NSDictionary * result = [[NSDictionary alloc]initWithObjectsAndKeys:image,@"image",id,@"id",nil]; // target is the instance of the UIView subclass that will use // the image [target performSelectorOnMainThread:@selector(updateContentWithData:) withObject:result waitUntilDone:NO]; [result release]; [image release]; [pool release]; } The updateContentWithData: of the UIView subclass performed on the main thread is just as simple -(void)updateContentWithData:(NSDictionary *)someData { NSDictionary * data = [someData retain]; if([[data valueForKey:@"id"]isEqualToString:[self pendingRequestId]]) { UIImage * image = [data valueForKey:@"image"]; [self setCurrentImage:image]; [self setNeedsDisplay]; } // If the image has not been retained, it should be released together // with the dictionary retaining it [data release]; } The drawLayer:inContext: method of the subclass will just get the CGImage from the UIImage and use it to update the backing layer or part of it. No retain or release is involved in the process. The problem is that after a while I run out of memory. The number of the UIViews is static. CGImageRef and UIImage are created, retained and released correctly (or so it seems to me). Instruments does not show any leaks, just the free memory available dip constantly, rise a few times, and then dip even lower until the application is terminated. The app cycles through about 2-300 of the aforementioned pages before that, but I would expect to have the memory usage reach a more or less stable level of used memory after a bunch of pages have been already skimmed at fast speed or, since the images are up to 3MB in size, deplete way earlier. Any suggestion will be greatly appreciated.

    Read the article

  • Validating class and superclass on RoR

    - by Luís Guilherme
    In ruby, you have an attribute called "type" which is the class of the object. Rails stores this at the database in a column called type. So, if I have several blog "types", I can do something like this def create @blog = Blog.new(params[:blog]) @blog[:type] = params[:blog][:type] # ... end If I add someone like this, and then load it, and ask its class (for instance, at the console), I have the right class name answered back. However, when I save it afterwards, rails will run only the superclass validators, not the ones I defined in the subclass. How should I make rails run the subclass validators?

    Read the article

  • Map Custom URL protocol to HTTP (using NSURLProtocol?)

    - by Francisco Ryan Tolmasky I
    I have an application using a WebKit WebView and I'd like to map URL's that are loaded in this WebView with a custom URL protocol to a different HTTP URL. For example, say I am loading: custom://path/to/resource I would like to internally actually load: http://something-else.com/path/to/resource In other words, the custom protocol serves almost as a shorthand. I can't however use -webView:resource:willSendRequest:redirectResponse:fromDataSource:, because I want WebKit to actually believe this is the URL in question, not to simply redirect from one to the other. So far I've been attempting to use a custom NSURLProtocol subclass. However, this is proving trickier than I first thought because, at least to my understanding, I will have to do the actual loading myself in the NSURLProtocol subclass' startLoading method. I'd like a way to just hand off the work to the existing HTTP protocol loader, but I can't find an easy way to do this. Does anyone have a recommendation for this, or perhaps an alternative way to solve this issue? Thanks!

    Read the article

  • polymorphic hql

    - by Berryl
    I have a base type where "business id" must be unique for a given subclass, but it is possible for there to be different subclasses with the same business id. If there is a base type with a requested id but of the wrong subclass I want to return null, using a named query. The code below does this, but I am wondering if I can avoid the try/catch with a better HQL. Can I? Cheers, Berryl current hql <query name="FindActivitySubjectByBusinessId"> <![CDATA[ from ActivitySubject act where act.BusinessId = :businessId ]]> </query> current fetch code public ActivitySubject FindByBusinessId<T>(string businessId) where T : ActivitySubject { Check.RequireStringValue(businessId, "businessId"); try { return _session.GetNamedQuery("FindActivitySubjectByBusinessId") .SetString("businessId", businessId) .UniqueResult<T>(); } catch (InvalidCastException e) { // an Activity Subject was found with the requested id but the wrong type return null; } }

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >